External structure definitions

M

mister

I'm using a static library that contains a function whose parameters
include a structure defined within that library. But when I declare
the external function I get errors due to the structure being unknown.
(since it's defined in the library, not my program)

How should I go about telling the linker where the definition for the
structure is? Is it similar to to using extern to declare functions
and variables? Any thoughts?

Thanks,
Nick
 
M

Marc

mister said:
I'm using a static library that contains a function whose parameters
include a structure defined within that library. But when I declare
the external function I get errors due to the structure being unknown.
(since it's defined in the library, not my program)

Did someone really give you a library without a .h file to include in
your code?
 
J

JKop

mister posted:
I'm using a static library that contains a function whose parameters
include a structure defined within that library. But when I declare
the external function I get errors due to the structure being unknown.
(since it's defined in the library, not my program)

How should I go about telling the linker where the definition for the
structure is? Is it similar to to using extern to declare functions
and variables? Any thoughts?

Thanks,
Nick


The beauty of header files.


#include "libraryheader.hpp"

int main()
{


}


-JKop
 
M

mister

So it must be within a header file? I'll see about getting the source
for the library so I can find out how the structs are defined and make
my own header file. Thanks
 
S

Stone Lan

but it seems weird that the lib is provide without related header files
which contain needed type defination,isn't it?
 
J

JKop

Stone Lan posted:
but it seems weird that the lib is provide without related header files
which contain needed type defination,isn't it?


Maybe it's a shit library.


-JKop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top