Trying to make CLion working with CMake and Cocos2DX

Updated step by step:

Need to resolve the Resources problem, really awful :frowning: even if the solution proposed by @romsvm is working

I had try “Levis” 's method, I encount some problem:
…msys64/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/5.2.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find -lbullet
…msys64/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/5.2.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find -lrecast

how to fix it?

I’ve just updated Cocos v3.9 and I have tried a new compile, without success.
The same error like you.

Furthermore it seems that: mingw-w64-x86_64-cocos2d-x-git no longer exists

So I have to install more things:

pacman -S mingw-w64-x86_64-openal mingw-w64-x86_64-libvorbis mingw-w64-x86_64-glfw mingw-w64-x86_64-pkg-config mingw-w64-x86_64-glew mingw-w64-x86_64-mpg123 mingw-w64-x86_64-freetype mingw-w64-x86_64-libwebp mingw-w64-x86_64-tinyxml2 mingw-w64-x86_64-libwebsockets mingw-w64-x86_64-xxhash mingw-w64-x86_64-flatbuffers mingw-w64-x86_64-bullet

I have found only bullet library in mingw, but not recast.
Anyway the errors after linking are both for Bullet and Recast

Somebody have fixed this?

cocos2dproj.zip (7.3 KB)
Hey, Levis! I had uploaded my cmake config file. you can try it.

no need to install package that list below:
tinyxml2
xxhash
flatbuffers
bullet

the only two big problem by now I encount is that the libcocos2d.a library file and the target MyGame.exe file are too large, and building project is slow.

2 Likes

Thank you I’ll try soon the -fpermissive flag!

Hey Ricardo, I’ve tried using CMake make/ninja to build a fresh Cocos2d-x game project on OS X / Linux and never had success. Is there a suggested way to setup the cmake OS X/Linux build, or should I read through the replies here and try to sort it out? I’m currently getting the same '‘glfw3.h’ file not found" error as the user here.

Simply put, are there any steps other than running cmake on the CMakeLists.txt and then building?