function in library
Hey y''all,
I''m coding a simple graphics library and everthing''s going all right except when I try to call a function from the library, I always get this error:
unresolved external symbol _FunctionName
1 unresolved externals
After the first time I got this error I went back and made all my functions external with the ''extern'' keyword, but that gave me the same error. What''s wrong?
-AJ
It''s a linkage error. It can''t find that function. If it''s a C function make sure the header has a C++ check to add extern "C" { et cetera } around the extern prototypes. I''m assuming you are linking the source/object/library/whatever files with the actual function in it.
Hey,
Just cycling this back to the top to see if Null and Void, or anyone else, could tell me how to do what Null and Void said in his reply. Thanks.
-AJ
Just cycling this back to the top to see if Null and Void, or anyone else, could tell me how to do what Null and Void said in his reply. Thanks.
-AJ
Like this:
This should be in your .h file. As N&V said, make sure you are actually linking with your library.
#ifdef __cplusplusextern "C" {#endifvoid YourFunction();#ifdef __cplusplus}#endif
This should be in your .h file. As N&V said, make sure you are actually linking with your library.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement