Sign in to follow this  
Marcella

errors LNK2019 and 1120

Recommended Posts

Marcella    127
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
jflanglois    1020
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
griffin2000    214
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
Marcella    127
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

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