I have loaded a new version of the cocos engine and created default application. Then I have tried to build and run it using cocos utility but I have got the following error:
CMake Error at cocos2d/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find Chipmunk (missing: CHIPMUNK_LIBRARIES CHIPMUNK_INCLUDE_DIR)
Call Stack (most recent call first):
cocos2d/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
cocos2d/cmake/Modules/FindChipmunk.cmake:77 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cocos2d/cmake/Modules/CocosBuildHelpers.cmake:44 (find_package)
cocos2d/CMakeLists.txt:238 (cocos_find_package)
Unfortunately, I am not cmake-rockstar ): Please, can anyone help me?
jtsm@ubuntu:~$ cocos new MyCppGame -p com.slackmoehrle.game -l cpp -d .
> Copy template into /home/jtsm/cocos2d-x/MyCppGame
> Copying cocos2d-x files...
> Rename project name from 'HelloCpp' to 'MyCppGame'
> Replace the project name from 'HelloCpp' to 'MyCppGame'
> Replace the project package name from 'org.cocos2dx.hellocpp' to 'com.slackmoehrle.game'
> Replace the Mac bundle id from 'org.cocos2dx.hellocpp' to 'com.slackmoehrle.game'
> Replace the iOS bundle id from 'org.cocos2dx.hellocpp' to 'com.slackmoehrle.game'
jtsm@ubuntu:~$
jtsm@ubuntu:~$ cd MyCppGame
jtsm@ubuntu:~/MyCppGame$ cocos run -p linux
Hi,
I’ve been trying to install and use cocos2d-x on Ubuntu 15.10 32 bit but errors keep showing up. Here’s the complete procedure I followed and the error that occurs:
in my /home/morpheus/Scrivania I made a directory called mygame and changed directory into /home/morpheus/Scrivania
cocos new MyGame -p com.your_company.mygame -l cpp -d ./mygame/
cd cocos2d-x/build/
./install-deps-linux.sh
cocos run -p linux
The error that occurs is:
It appears you are builing natively for Linux with GCC
-- OpenGL include dirs: /usr/include
-- GLEW include dirs: /usr/include
-- PkgConfig found
-- GLFW3 include dirs: /usr/local/include/GLFW
-- FMOD include dirs: /home/morpheus/Scrivania/mygame/MyGame/cocos2d/external/linux-specific/fmod/include
-- Fontconfig include dirs: /usr/include/freetype2
-- GTK3 include dirs: /usr/include/gtk-3.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib/i386-linux-gnu/dbus-1.0/include;/usr/include/gtk-3.0;/usr/include/gio-unix-2.0/;/usr/include/mirclient;/usr/include/mircommon;/usr/include/cairo;/usr/include/pango-1.0;/usr/include/harfbuzz;/usr/include/pango-1.0;/usr/include/atk-1.0;/usr/include/cairo;/usr/include/pixman-1;/usr/include/freetype2;/usr/include/libpng12;/usr/include/gdk-pixbuf-2.0;/usr/include/libpng12;/usr/include/glib-2.0;/usr/lib/i386-linux-gnu/glib-2.0/include
-- Freetype include dirs: /home/morpheus/Scrivania/mygame/MyGame/cocos2d/external/freetype2/include/linux;/home/morpheus/Scrivania/mygame/MyGame/cocos2d/external/freetype2/include/linux
-- WebP include dirs: /home/morpheus/Scrivania/mygame/MyGame/cocos2d/external/webp/include/linux
CMake Error at cocos2d/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find Chipmunk (missing: CHIPMUNK_LIBRARIES CHIPMUNK_INCLUDE_DIR)
Call Stack (most recent call first):
cocos2d/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
cocos2d/cmake/Modules/FindChipmunk.cmake:77 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cocos2d/cmake/Modules/CocosBuildHelpers.cmake:44 (find_package)
cocos2d/cmake/Modules/BuildModules.cmake:45 (cocos_find_package)
cocos2d/CMakeLists.txt:92 (BuildModules)
Can anyone confirm that it’s possible to use cocos2d-x v3.11 on Ubuntu? Nobody has experienced these errors?
I wanted to use cocos framework so much but I’m starting to get tired of wasting so much time just to install the framework, create and build a new project.
EDIT: after executing sudo apt-get install chipmunk-dev the previous error seems to be solved but then if I execute cocos run -p linux another bunch of errors show up like:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointLimit::getAnchr1() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:307:82: error: ‘cpSlideJointGetAnchorA’ was not declared in this scope
return PhysicsHelper::cpv2point(cpSlideJointGetAnchorA(_cpConstraints.front()));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘void cocos2d::PhysicsJointLimit::setAnchr1(const cocos2d::Vec2&)’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:312:83: error: ‘cpSlideJointSetAnchorA’ was not declared in this scope
cpSlideJointSetAnchorA(_cpConstraints.front(), PhysicsHelper::point2cpv(anchr));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointLimit::getAnchr2() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:317:82: error: ‘cpSlideJointGetAnchorB’ was not declared in this scope
return PhysicsHelper::cpv2point(cpSlideJointGetAnchorB(_cpConstraints.front()));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘void cocos2d::PhysicsJointLimit::setAnchr2(const cocos2d::Vec2&)’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:322:83: error: ‘cpSlideJointSetAnchorB’ was not declared in this scope
cpSlideJointSetAnchorB(_cpConstraints.front(), PhysicsHelper::point2cpv(anchr));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointSpring::getAnchr1() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:408:84: error: ‘cpDampedSpringGetAnchorA’ was not declared in this scope
return PhysicsHelper::cpv2point(cpDampedSpringGetAnchorA(_cpConstraints.front()));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘void cocos2d::PhysicsJointSpring::setAnchr1(const cocos2d::Vec2&)’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:413:85: error: ‘cpDampedSpringSetAnchorA’ was not declared in this scope
cpDampedSpringSetAnchorA(_cpConstraints.front(), PhysicsHelper::point2cpv(anchr));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointSpring::getAnchr2() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:418:84: error: ‘cpDampedSpringGetAnchorB’ was not declared in this scope
return PhysicsHelper::cpv2point(cpDampedSpringGetAnchorB(_cpConstraints.front()));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘void cocos2d::PhysicsJointSpring::setAnchr2(const cocos2d::Vec2&)’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:423:85: error: ‘cpDampedSpringSetAnchorB’ was not declared in this scope
cpDampedSpringSetAnchorB(_cpConstraints.front(), PhysicsHelper::point2cpv(anchr));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointGroove::getAnchr2() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:513:83: error: ‘cpGrooveJointGetAnchorB’ was not declared in this scope
return PhysicsHelper::cpv2point(cpGrooveJointGetAnchorB(_cpConstraints.front()));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘void cocos2d::PhysicsJointGroove::setAnchr2(const cocos2d::Vec2&)’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:518:85: error: ‘cpGrooveJointSetAnchorB’ was not declared in this scope
cpGrooveJointSetAnchorB(_cpConstraints.front(), PhysicsHelper::point2cpv(anchr2));
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointLimit::getAnchr1() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:308:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointLimit::getAnchr2() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:318:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointSpring::getAnchr1() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:409:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointSpring::getAnchr2() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:419:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp: In member function ‘cocos2d::Vec2 cocos2d::PhysicsJointGroove::getAnchr2() const’:
/home/morpheus/Scrivania/mygame/MyGame/cocos2d/cocos/physics/CCPhysicsJoint.cpp:514:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
cocos2d/cocos/CMakeFiles/cocos2dInternal.dir/build.make:2699: set di istruzioni per l'obiettivo "cocos2d/cocos/CMakeFiles/cocos2dInternal.dir/physics/CCPhysicsJoint.cpp.o" non riuscito
make[2]: *** [cocos2d/cocos/CMakeFiles/cocos2dInternal.dir/physics/CCPhysicsJoint.cpp.o] Errore 1
CMakeFiles/Makefile2:562: set di istruzioni per l'obiettivo "cocos2d/cocos/CMakeFiles/cocos2dInternal.dir/all" non riuscito
make[1]: *** [cocos2d/cocos/CMakeFiles/cocos2dInternal.dir/all] Errore 2
Makefile:75: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
Error running command, return code: 2.
I posted a few screenshots of it working for me. I am happy to try with a 32-bit version. I am using a 64-bit version. I’ll need to download a 32-bit version, so give me some time to test this, please.
I too am having the same issues with the 32-bit version of Ubuntu with cocos v3.11.1. It looks like it’s missing the 32-bit chipmunk library in the prebuilt folder for linux. After adding the 32-bit library from an earlier version of cocos, I get the same error as condorwasabi.
You need to build the latest libchipmunk.a static library to make it work on linux 32-bit system. As of now cocos2d-x contains only the 64-bit version.
Follow the instructions here to build it.
Clone the repo. After installling the prequisites go to the build directory and open terminal and type:
./build.sh -p=linux --libs=chipmunk --arch=i386
This will build the required library. Just copy the libchipmunk.a file from the i386 folder to the 32-bit folder (create it if it doesn’t exist) in your project.