Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

redneckCoder

function in library

This topic is 6031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Like this:

#ifdef __cplusplus
extern "C" {
#endif
void YourFunction();
#ifdef __cplusplus
}
#endif

This should be in your .h file. As N&V said, make sure you are actually linking with your library.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!