-1

I got a LNK2019 error in Visual Studio 2013 when I changed a file. When you create a new Cocos2D-X project you start with a basic project with 2 cpp files and 2 header files.

I changed the HelloWorldScene (header & cpp) file to another name. Now I am getting a LNK2019 error :

Error   5   error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup   C:\Users\bette_000\Documents\GitHub\TheAdventuresOfJos\MyGame\proj.win32\MSVCRTD.lib(crtexe.obj)    MyGame
Error   6   error LNK1120: 1 unresolved externals   C:\Users\bette_000\Documents\GitHub\TheAdventuresOfJos\MyGame\proj.win32\Debug.win32\MyGame.exe 1   1   MyGame

I used to have these files:

  • AppDelegate.cpp (& .h)
  • BeginMenu.cpp (& .h)
  • globals.h
  • HelloWorldScene.cpp (& .h)
  • OptionsMenu.cpp (& .h)

This worked. But since I changed the name of HelloWorldScene.cpp (& .h) to MainApp.cpp (& .h) I got this error.

Glenn Bettens
  • 65
  • 1
  • 8
  • Well, I'd be looking at this `_main` symbol that you've referenced somewhere. Did you mean `_tmain` instead? – Rook May 14 '14 at 13:51

1 Answers1

0

Perhaps somehow your linker settings got confused, try

Project -> Properties -> Configuration Properties -> Linker -> System

and change SubSystem to Console.

Original post in stackoverflow for this solution

Community
  • 1
  • 1