更改文件时,我在 Visual Studio 2013 中遇到 LNK2019 错误。当您创建一个新的 Cocos2D-X 项目时,您会从一个包含 2 个 cpp 文件和 2 个头文件的基本项目开始。
我将 HelloWorldScene (header & cpp) 文件更改为另一个名称。现在我收到 LNK2019 错误:
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
我曾经有这些文件:
- AppDelegate.cpp (&.h)
- 开始菜单.cpp (& .h)
- 全局变量.h
- HelloWorldScene.cpp (& .h)
- 选项菜单.cpp (& .h)
这行得通。但是由于我将 HelloWorldScene.cpp (& .h) 的名称更改为 MainApp.cpp (& .h) 我收到了这个错误。