Thursday, January 25, 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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...