Jump to content
  • Advertisement
Sign in to follow this  
Marcella

errors LNK2019 and 1120

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

Hello, im new to D3D programming in c++ and when making my first directX program (the second one from the orginal tutorials) I encountered a serious number of errors, but now I think im finnaly trough, I cant solve these two guys: Error 1 error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup MSVCRTD.lib Error 2 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\World of Warcraft\Mijn documenten\Visual Studio 2005\Projects\tut22\Debug\tut22.exe 1 I'm using MVS 2005. and already included these libs: d3dx9.lib d3dxof.lib dxguid.lib DxErr9.lib d3d9.lib thanks, Marcella

Share this post


Link to post
Share on other sites
Advertisement
mainCRT linker errors usually pertain to a problem with (or absence of) your main() function, or in windows' case, WINMAIN()

Share this post


Link to post
Share on other sites
Quote:
Original post by datadawgx
mainCRT linker errors usually pertain to a problem with (or absence of) your main() function, or in windows' case, WINMAIN()


Indeed, in this case the main() function is missing. But you probably don't want to write it, so you need to got to Project Menu->tut22 Properties->Configuration Properties->Linker->System->SubSystem and set it to Windows.


jfl.

Share this post


Link to post
Share on other sites
In the propeties of your project, look in Linker->System->SubSystem. If this is set to 'Windows' you need to have a WinMain function that looks like this:

INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )

If this is set to 'Console' you need a traditional Main function that looks like this:

int main(int argc, char *argv[])

If you have them the wrong way round (in your case possible a project that is set to console with no main function, only a WinMain). You will get link errors.

Share this post


Link to post
Share on other sites
Quote:
Original post by jflanglois
Quote:
Original post by datadawgx
mainCRT linker errors usually pertain to a problem with (or absence of) your main() function, or in windows' case, WINMAIN()


Indeed, in this case the main() function is missing. But you probably don't want to write it, so you need to got to Project Menu->tut22 Properties->Configuration Properties->Linker->System->SubSystem and set it to Windows.


jfl.


It worked! Thanks alot.

/Marcella

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!