Jump to content

  • Log In with Google      Sign In   
  • Create Account

unresolved external symbol _WinMain@16


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1   Members   

119
Like
0Likes
Like

Posted 23 April 2013 - 05:38 PM

#include <windows.h>
int WINAPI winMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{
    MessageBox(NULL,L"Some text",L"Info",MB_OKCANCEL | MB_ICONINFORMATION);

    return 0;
}

Error    1    error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup    C:\Bob\Projects\Part1\Part1\MSVCRTD.lib(crtexew.obj)    Part1



#2   Members   

5165
Like
0Likes
Like

Posted 23 April 2013 - 10:48 PM

That .cpp/.c file where you entered that code, make sure you add it to the project. Right Click on the Solution Explorer and choose "Add". Once the file shows up there it should be compiled and linked.


Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

#3   Members   

7786
Like
5Likes
Like

Posted 23 April 2013 - 11:39 PM

*
POPULAR

It should be WinMain not winMain, that's about it.



#4   Members   

33494
Like
0Likes
Like

Posted 24 April 2013 - 10:44 AM

Why was the original post deleted? In the GameDev.net community, we generally leave them in place for future programmers who have the same problem.

 

Zaoshi Kaba's solution is the correct answer; it's an easy mistake to make and one that future programmers will likely make and need to know the solution of. 


It's perfectly fine to abbreviate my username to 'Servant' or 'SotL' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal | [Fly with me on Twitter]




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.