Jump to content
  • Advertisement
Sign in to follow this  
FadedMaximus

Linking Files to Projects

This topic is 4521 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 tried compiling a project I made and I got the following error:
Linking...
MSVCRTD.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Inflight.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I know there is a file that isn't linked in the project and that is why I am getting this error - but I don't know what file I need to link in order to fix this problem.

Share this post


Link to post
Share on other sites
Advertisement
Actually the problem is probably that you created a Window application project instead of a console application project*. You can go to your linker options to change the subsystem from Windows to Console.


*Unless this is an SDL project in which case you probably forget to link against SDLmain.lib.

Share this post


Link to post
Share on other sites
Yeah I forgot to mention that it was a SDL project. When I tried linking the sdlmain library I got this error:


Linking...
MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
sdlmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_main
Debug/Inflight.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Share this post


Link to post
Share on other sites
Go to your code generation options in the project settings under C/C++. Change the C runtime version to use the Multithreaded DLL version of the CRT.

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.

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!