Cocos2d-x unresolved external symbol 'ccNextPOT'

500 views Asked by At

Build Cocos2d-x v3.4 game for Win32 in Visual Studio 2013. After adding call of ccNextPOT method

// test call
int w = cocos2d::ccNextPOT(300);

got next error

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

Error appears for Debug and Release builds. Without this call project is builded fine.

1

There are 1 answers

0
Petro Shm On

Add CC_DLL to function definition in ccUtils.h. It makes function visible in libcocos2d.dll library. It should have the next look:

int CC_DLL ccNextPOT(int value);