Thursday, 25 January 2018

c++ - LNK2019 Error Cocos2D-X

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.

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...