Skip to main content
Participant
December 7, 2021
Answered

Why can't I find many structs definition in header files of PDFL SDK?

  • December 7, 2021
  • 2 replies
  • 517 views

When I follow the header files in PDFL SDK, I found there are many structs which don't have a complete type.

 

For example, there is a definition:

 

typedef struct _t_PDDoc *PDDoc;

 

 

However, there is no definition of `struct _t_PDDoc`. And I also don't find any code which make it import.

 

So, how can the code complie successfully? What is the type indeed? When I try to use the `struct _t_PDDoc` directly in my code, there is always a mistake made by VS.

This topic has been closed for replies.
Correct answer Test Screen Name

The code can compile successfully because that is how C and C++ are defined. Pointers to an undefined structure are all pointers so they can be compiled. The compiler does type checking so they are distinct. 

These are called opaque types. There are many in the PDF library (in this case, identical to the Acrobat SDK).  I have no idea why you would want to use the PDDoc structure in your code, but whatever the reason, you can't. 

2 replies

Test Screen NameCorrect answer
Legend
December 7, 2021

The code can compile successfully because that is how C and C++ are defined. Pointers to an undefined structure are all pointers so they can be compiled. The compiler does type checking so they are distinct. 

These are called opaque types. There are many in the PDF library (in this case, identical to the Acrobat SDK).  I have no idea why you would want to use the PDDoc structure in your code, but whatever the reason, you can't. 

Participant
December 7, 2021

Thank you, I got it.

Bernd Alheit
Community Expert
Community Expert
December 7, 2021

Contact the support of this library.