Sign in to follow this  
BloodLust666 (dupe)

linking problems with created lib

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this