在Visual Studio 2013中为 Win32 构建 Cocos2d-x v3.4 游戏。 添加 ccNextPOT 方法
的调用后// test call
int w = cocos2d::ccNextPOT(300);
有下一个错误
1>HelloWorldScene.obj : error LNK2019: unresolved external symbol "int __cdecl cocos2d::ccNextPOT(int)" (?ccNextPOT@cocos2d@@YAHH@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@@UAE_NXZ)
1>C:\Users\User\Documents\Projects\TestGame\proj.win32\Debug.win32\TestGame.exe : fatal error LNK1120: 1 unresolved externals
Debug和Release版本出现错误。如果没有这个电话,项目就会很好。
答案 0 :(得分:1)
将CC_DLL
添加到 ccUtils.h 中的功能定义。它使函数在 libcocos2d.dll 库中可见。它应该具有下一个外观:
int CC_DLL ccNextPOT(int value);