Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666 (dupe)

linking problems with created lib

This topic is 4110 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

I have a solution with two projects. One project (that is compiled first), compiles a .lib file. The second project is a standard .exe Windows application. Just to see if my lib is included i only have one file in the exe and ther's only: #include "WrathEngine.h" #pragma comment(lib, "WrathEngine.lib") int main(int argc, char *argv[]) { return 0; } but i keep getting this error 3D Engine Test error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup i've looked all over and one place said make sure i have use of ATL to no and the subsystem to windows and i have that but it's still giving that linking issue.

Share this post


Link to post
Share on other sites
Advertisement
I assume there are no problems until you inlude the header and link the library?

If that is the case, check the header out, make sure you are not missing semi-colons and parenthesise etc.

Dave

Share this post


Link to post
Share on other sites
yep, when i comment those two lines out, it works. This header out, are you just talking about that header i'm including? or is there another header that compiles that i need to check

also, when i link api libraries (such as sdl and opengl) in WrathEngine do i need to link all the libs and dlls in the exe project? i'm thinking also that sdl has something to do with it because it redefines main to SDL_main

Share this post


Link to post
Share on other sites
Well if you are using static libraries and you have written a static library that links other static libraries, you must link the libraries that you library depends on into the application you are using your library in. If that makes sense.

There is prolly some syntax error in the header or something here. Is this all the code from the main file?

Share this post


Link to post
Share on other sites
yea that makes sense. So in a way it's like i need to double link. Link the libs to my exe and MY lib. and the same libs that i link to my exe are linked to my lib. yep.. tried that.

and yea, that's all the code in main.cpp

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!