linking problems with created lib

Started by
3 comments, last by BloodLust666 (dupe) 17 years ago
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.
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!
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
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
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!
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?
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
Eddie RiveronSoftware EngineerCreator of 3D Wrath EngineWebsite soon!

This topic is closed to new replies.

Advertisement