linking problems with created lib
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.
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
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
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
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?
There is prolly some syntax error in the header or something here. Is this all the code from the main file?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement