Unable to compile 13-beta tests on Linux

when i try to compile tests for linux it fails :frowning: , but works for android. how to fix this ?

**********************building cocos2dx**************************
make: *** No rule to make target `../platform/Linux/CCAplication_linux.o', needed by `libcocos2d.so'.  Stop.
cp: cannot stat `libcocos2d.so': No such file or directory
**********************building cocosdenshion*********************
make: *** No rule to make target `../Linux/FmodAudioPlayer.o', needed by `libcocosdenshion.so'.  Stop.
cp: cannot stat `libcocosdenshion.so': No such file or directory
**********************building Box2D******************************
make: `libbox2d.a' is up to date.
**********************building chipmunk***************************
make: `libchipmunk.a' is up to date.
js@js:~/Downloads/mob/cocos2d-1.0.1-x-0.12.0$ cd ../*beta/tests/test.linux
js@js:~/Downloads/mob/cocos2d-1.0.1-x-0.13.0-beta/tests/test.linux$ ls
main.cpp  main.h  main.o  Makefile
js@js:~/Downloads/mob/cocos2d-1.0.1-x-0.13.0-beta/tests/test.linux$ make
g++ -Wall -g -O2  -I../ -I../../cocos2dx/platform/third_party/linux -I../../cocos2dx/include -I../../cocos2dx -I../../cocos2dx/platform -I../../CocosDenshion/include -I../../chipmunk/include/chipmunk -I../../  -DLINUX ../tests/AccelerometerTest/AccelerometerTest.o ../tests/ActionManagerTest/ActionManagerTest.o ../tests/ActionsTest/ActionsTest.o ../tests/Box2DTest/Box2dTest.o ../tests/Box2DTestBed/Box2dView.o ../tests/Box2DTestBed/GLES-Render.o ../tests/Box2DTestBed/Test.o ../tests/Box2DTestBed/TestEntries.o ../tests/BugsTest/Bug-1159.o ../tests/BugsTest/Bug-1174.o ../tests/BugsTest/Bug-350.o ../tests/BugsTest/Bug-422.o ../tests/BugsTest/Bug-624.o ../tests/BugsTest/Bug-886.o ../tests/BugsTest/Bug-899.o ../tests/BugsTest/Bug-914.o ../tests/BugsTest/Bug-458/Bug-458.o ../tests/BugsTest/Bug-458/QuestionContainerSprite.o ../tests/BugsTest/BugsTest.o ../tests/ChipmunkTest/Bounce.o ../tests/ChipmunkTest/Joints.o ../tests/ChipmunkTest/LogoSmash.o ../tests/ChipmunkTest/MagnetsElectric.o ../tests/ChipmunkTest/OneWay.o ../tests/ChipmunkTest/Planet.o ../tests/ChipmunkTest/Player.o ../tests/ChipmunkTest/Plink.o ../tests/ChipmunkTest/Pump.o ../tests/ChipmunkTest/PyramidStack.o ../tests/ChipmunkTest/PyramidTopple.o ../tests/ChipmunkTest/Query.o ../tests/ChipmunkTest/Sensors.o ../tests/ChipmunkTest/Simple.o ../tests/ChipmunkTest/Springies.o ../tests/ChipmunkTest/Tank.o ../tests/ChipmunkTest/TheoJansen.o ../tests/ChipmunkTest/Tumble.o ../tests/ChipmunkTest/UnsafeOps.o ../tests/ChipmunkTest/cocos2dChipmunkDemo.o ../tests/ChipmunkTest/drawSpace.o ../tests/ClickAndMoveTest/ClickAndMoveTest.o ../tests/CocosDenshionTest/CocosDenshionTest.o ../tests/CocosNodeTest/CocosNodeTest.o ../tests/CurlTest/CurlTest.o ../tests/CurrentLanguageTest/CurrentLanguageTest.o ../tests/DirectorTest/DirectorTest.o ../tests/DrawPrimitivesTest/DrawPrimitivesTest.o ../tests/EaseActionsTest/EaseActionsTest.o ../tests/EffectsAdvancedTest/EffectsAdvancedTest.o ../tests/EffectsTest/EffectsTest.o ../tests/FontTest/FontTest.o ../tests/HiResTest/HiResTest.o ../tests/IntervalTest/IntervalTest.o ../tests/KeypadTest/KeypadTest.o ../tests/LabelTest/LabelTest.o ../tests/LayerTest/LayerTest.o ../tests/MenuTest/MenuTest.o ../tests/MotionStreakTest/MotionStreakTest.o ../tests/ParallaxTest/ParallaxTest.o ../tests/ParticleTest/ParticleTest.o ../tests/PerformanceTest/PerformanceNodeChildrenTest.o ../tests/PerformanceTest/PerformanceParticleTest.o ../tests/PerformanceTest/PerformanceSpriteTest.o ../tests/PerformanceTest/PerformanceTest.o ../tests/PerformanceTest/PerformanceTextureTest.o ../tests/PerformanceTest/PerformanceTouchesTest.o ../tests/ProgressActionsTest/ProgressActionsTest.o ../tests/RenderTextureTest/RenderTextureTest.o ../tests/RotateWorldTest/RotateWorldTest.o ../tests/SceneTest/SceneTest.o ../tests/SchedulerTest/SchedulerTest.o ../tests/SpriteTest/SpriteTest.o ../tests/TextInputTest/TextInputTest.o ../tests/TextureCacheTest/TextureCacheTest.o ../tests/Texture2dTest/Texture2dTest.o ../tests/TileMapTest/TileMapTest.o ../tests/TouchesTest/Ball.o ../tests/TouchesTest/Paddle.o ../tests/TouchesTest/TouchesTest.o ../tests/TransitionsTest/TransitionsTest.o ../tests/UserDefaultTest/UserDefaultTest.o ../tests/ZwoptexTest/ZwoptexTest.o ../tests/ExtensionsTest/NotificationCenterTest.o ../tests/ExtensionsTest/ExtensionsTest.o ../tests/controller.o ../tests/testBasic.o ../AppDelegate.o ./main.o  -o cocos2dx-test -L../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../lib/linux/Debug/ ../../lib/linux/Debug/libbox2d.a ../../lib/linux/Debug/libchipmunk.a ../../cocos2dx/platform/third_party/linux/libraries/libcurl.a 
../../cocos2dx/platform/third_party/linux/libraries/libcurl.a(timeval.o): In function `curlx_tvnow':
timeval.c:(.text+0x89): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [cocos2dx-test] Error 1

Hi,

i have just started with cocos-2d-x, I haven’t been able to compile it yet, but i think i have seen the problem you are describing in the github issues (not sure).
In the Makefile at cocos2dx/proj.linux change the reference from …/platform/Linux/CCAplication_linux.o -> to linux in lowercase. The github issue where probably better explained: https://github.com/cocos2d/cocos2d-x/issues/757

The problem that i’m facing is the following:

**********************building cocosdenshion********************* g++ -Wall -g -O2 -fPIC -I.. -I../include -I../third_party/linux/fmod/lib64/api/inc -DLINUX ../linux/FmodAudioPlayer.o ../linux/SimpleAudioEngine.o -shared -o libcocosdenshion.so -L../third_party/linux/fmod/lib64/api/lib -lfmodex64 /usr/bin/ld:../third_party/linux/fmod/lib64/api/lib/libfmodex64.so: file format not recognized; treating as linker script /usr/bin/ld:../third_party/linux/fmod/lib64/api/lib/libfmodex64.so:1: syntax error collect2: ld returned 1 exit status make: *** [libcocosdenshion.so] Error 1 cp: cannot stat `libcocosdenshion.so': No such file or directory

I’m also using linux (Ubuntu 12.04), so could you let me know if the problem i’m facing also affects you?, and if anyone knows an answer, please share it!

Hi ,

I fixed my problem , By adding -lrt to Makefile the test project compiled successfully. May be the libcurl.a needs the parameter.

@Javi M We are working with cocos2d-x(12/13beta) using Ubuntu without any problems,And this problem we got is about to test-project provided with cocos2dx(13-beta)

Hi Sridher, could you pull a request to our repo fixing this bug?

Hi Waizer Wang, I placed a pull request https://github.com/cocos2d/cocos2d-x/pull/1076