did you do anything else? I only see mention of running ./install-deps-linux.sh
I am trying to build cocos2d-x using make-all-linux-project.sh which also runs install-deps-linux. It doesnt complain about any missing dependencies, other than glfw3 the first time I ran it. So I followed http://stackoverflow.com/questions/17768008/how-to-build-install-glfw-3-and-use-it-in-a-linux-project to build glfw from source. Did you not have to do this from your plain ubuntu install?
Now, running make-all-linux-project.sh begins to build everything but eventually aborts on the above error LINK ../../lib/linux/debug/libcocos2d.so /usr/bin/ld: error: /usr/local/lib/libglfw3.a(context.c.o): requires unsupported dynamic reloc 11; recompile with -fPIC
I can see that the cocos2d.mk file already specifies -fPIC as part of the gcc compile flags, but that is as much as I know
thanks for the help. I had glfw2 installed, so I removed that and now the dependencies are all taken care of.
I am still having issues building cocos2d-x though. Now, running make-all-linux-project.sh I see the following:
@
rm f bin/release/TestCpp core
make[1]: Leaving directory `/home/mike/projects/cocos2d/cocos2d-x/samples/Cpp/TestCpp/proj.linux’
makeC external/chipmunk/proj.linux
make: Circular libextensions <- cocosdenshion dependency dropped
@
and also the sample projects fail to build after this error: make[1]: *** No rule to make target `obj/debug/auto-generated/lua-bindings/lua_cocos2dx_auto.o', needed by `/home/mike/projects/cocos2d/cocos2d-x/lib/linux/debug/liblua.so'. Stop.
When I try to build them myself, for example cd samples/Cpp/TestCpp/proj.linux/ && make DEBUG=1 all
it complains about the cocosdenshion.
While I am at it, I want to enable box2d over chipmunk, what is the correct way to do so? Should I just need to replace “chipmunk” with “box2d” in the “all” target in the toplevel Makefile ?
Make sure that you are using the latest commit from github/develop. It should be: 3e017e1a4249a4364ef9c51d0d79350ef957afa1
Lua bindings are not working on Linux as of today. It’s going to be fixed soon.
Besides Lua, the rest should work.
Just do:
$ cd cocos2d-x
$ make clean
$ ./install-deps-linux.sh
$ ./make-all-linux-project.sh
$ make # <--- do make again to compile release
$ cd samples/Cpp/TestCpp/proj.linux
$ make
And in bin/release and bin/debug you should have the binaries.
If it doesn’t work, please let me know.
thanks for the help, but I am still having issues. It does not compile completely cleanly, and when I try to build my sample project against it, it fails to find the cocosdension lib
make: *** No rule to make target `../../../cocos2d-x/lib/linux/debug/libcocosdenshion.so', needed by `bin/debug/HelloWorld'. Stop.
It looks like it is only with the debug build, the release build does have the cocosdenshion lib
In DEBUG mode the shared libcocosdenshion.so is missing under lib/linux/debug. I just copy it from lib/linux/release though to solve that issue for now.
My proj.linux build.sh script was still based off how it worked in an earlier rev of the cocos2d v3 branch. Having just generated a new sample project using the bundled tool, I can see that much more logic has been pushed into that build.sh script, including more dependency installation and I can see that it is building the Cocosdenshion debug lib as well.