Problems building on linux

I’m following http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_HelloWorld_and_tests_on_linux, I’ve git-cloned cocos, I have ndk & sdk & jdk installed but I can’t build the thing. I’ve built it, didn’t see any errors and tried to make helloworld which resulted in:

/usr/bin/ld: cannot find -lcocos2d /usr/bin/ld: cannot find -lcocosdenshion collect2: ld returned 1 exit status make: *** [HelloWorld] Error 1

Then I looked into build-linux.sh log and found lots of errors. Tried running it again and got this:
@
/usr/bin/ld: …/Linux/FmodAudioPlayer.o: relocation R_X86_64_32 against `.rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
…/Linux/FmodAudioPlayer.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: * [libcocosdenshion.so] Error 1
cp: cannot stat `libcocosdenshion.so’: No such file or directory@

Can you help me please?

I have fixed the problem tow days ago. You can try the latest code from git.

BTW: Linux port is available from 0.9.2, which is not released now. But thank you for your feedback.

I’ve known about the fixes however I’ve tried the latest code and didn’t work.

OK trying the latest version now. Thanks for the effort I hope cocos2d-x will surpass unity/marmelade/shiva in 2d games ASAP!

EDIT:
BTW any idea how to use git to just update? I’ve tried merge, pull, push but they seem to do completely different stuff, and clone wants a unique copy.

The git command is:

git pull https://github.com/cocos2d/cocos2d-x.git

The git command is:

git pull https://github.com/cocos2d/cocos2d-x.git

Thanks but, the same errors. I’ll try one last time.

Tried:
@
dany@dany-Veriton-X490G:~/cocos2d-x$ sudo ./build-linux.sh
building cocos2dx****
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCAction.cpp -o …/actions/CCAction.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionCamera.cpp -o …/actions/CCActionCamera.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionEase.cpp -o …/actions/CCActionEase.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionGrid.cpp -o …/actions/CCActionGrid.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionGrid3D.cpp -o …/actions/CCActionGrid3D.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionInstant.cpp -o …/actions/CCActionInstant.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionInterval.cpp -o …/actions/CCActionInterval.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionManager.cpp -o …/actions/CCActionManager.o
…/actions/CCActionManager.cpp: In member function ‘void cocos2d::CCActionManager::removeActionByTag(unsigned int, cocos2d::CCObject*)’:
…/actions/CCActionManager.cpp:291:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
…/actions/CCActionManager.cpp:304:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
…/actions/CCActionManager.cpp: In member function ‘cocos2d::CCAction* cocos2d::CCActionManager::getActionByTag(unsigned int, cocos2d::CCObject*)’:
…/actions/CCActionManager.cpp:317:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
…/actions/CCActionManager.cpp:331:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionPageTurn3D.cpp -o …/actions/CCActionPageTurn3D.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionProgressTimer.cpp -o …/actions/CCActionProgressTimer.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/actions/CCActionTiledGrid.cpp -o …/actions/CCActionTiledGrid.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/base_nodes/CCAtlasNode.cpp -o …/base_nodes/CCAtlasNode.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/base_nodes/CCNode.cpp -o …/base_nodes/CCNode.o
…/include/CCNode.h: In constructor ‘cocos2d::CCNode::CCNode()’:
…/include/CCNode.h:226:8: warning: ‘cocos2d::CCNode::m_bIsInverseDirty’ will be initialized after [-Wreorder]
…/include/CCNode.h:149:13: warning: ‘float cocos2d::CCNode::m_fSkewX’ [-Wreorder]
…/base_nodes/CCNode.cpp:46:1: warning: when initialized here [-Wreorder]
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/cocoa/CCAffineTransform.cpp -o …/cocoa/CCAffineTransform.o
g++ -Wall -g -O2 -I… -I…/platform/third_party/linux/libfreetype2 -I…/include -I…/platform -I…/platform/third_party/linux/libpng -I…/platform/third_party/linux/libxml2 -I…/platform/third_party/linux/libjpeg -DLINUX -c …/cocoa/CCAutoreleasePool.cpp -o …/cocoa/CCAutoreleasePool.o
In file included from …/include/CCAutoreleasePool.h:28:0,
from …/cocoa/CCAutoreleasePool.cpp:24:
…/include/CCMutableArray.h: In member function ‘unsigned int cocos2d::CCMutableArray::getIndexOfObject(T)’:
…/include/CCMutableArray.h:63:38: error: ‘NULL’ was not declared in this scope
…/include/CCMutableArray.h: In member function ‘T cocos2d::CCMutableArray::getLastObject()’:
…/include/CCMutableArray.h:111:10: error: ‘NULL’ was not declared in this scope
…/include/CCMutableArray.h: In member function ‘T cocos2d::CCMutableArray::getObjectAtIndex(unsigned int)’:
…/include/CCMutableArray.h:120:11: error: ‘NULL’ was not declared in this scope
…/include/CCMutableArray.h: In member function ‘void cocos2d::CCMutableArray::addObject(T)’:
…/include/CCMutableArray.h:130:18: error: ‘NULL’ was not declared in this scope
…/include/CCMutableArray.h: In member function ‘void cocos2d::CCMutableArray::insertObjectAtIndex(T, unsigned int)’:
…/include/CCMutableArray.h:160:18: error: ‘NULL’ was not declared in this scope
…/include/CCMutableArray.h: In static member function ‘static cocos2d::CCMutableArray* cocos2d::CCMutableArray::arrayWithArray(cocos2d::CCMutableArray)’:
…/include/CCMutableArray.h:347:41: error: ‘NULL’ was not declared in this scope
…/cocoa/CCAutoreleasePool.cpp: In constructor ‘cocos2d::CCPoolManager::CCPoolManager()’:
…/cocoa/CCAutoreleasePool.cpp:96:22: error: ‘NULL’ was not declared in this scope
…/cocoa/CCAutoreleasePool.cpp: In destructor ‘cocos2d::CCPoolManager::~CCPoolManager()’:
…/cocoa/CCAutoreleasePool.cpp:105:22: error: ‘NULL’ was not declared in this scope
make: *** […/cocoa/CCAutoreleasePool.o] Error 1
cp: cannot stat libcocos2d.so': No such file or directory **********************building cocosdenshion********************* g++ -Wall -g -O2 -I.. -I../include -I../third_party/fmod/api/inc -DLINUX -c ../Linux/FmodAudioPlayer.cpp -o ../Linux/FmodAudioPlayer.o ../Linux/FmodAudioPlayer.cpp: In member function ‘void CocosDenshion::FmodAudioPlayer::init()’: ../Linux/FmodAudioPlayer.cpp:40:15: warning: unused variable ‘version’ [-Wunused-variable] ../Linux/FmodAudioPlayer.cpp: In member function ‘virtual float CocosDenshion::FmodAudioPlayer::getEffectsVolume()’: ../Linux/FmodAudioPlayer.cpp:265:1: warning: no return statement in function returning non-void [-Wreturn-type] g++ -Wall -g -O2 -I.. -I../include -I../third_party/fmod/api/inc -DLINUX -c ../Linux/SimpleAudioEngine.cpp -o ../Linux/SimpleAudioEngine.o ../Linux/SimpleAudioEngine.cpp: In function ‘const char* CocosDenshion::_FullPath(const char*)’: ../Linux/SimpleAudioEngine.cpp:122:1: warning: no return statement in function returning non-void [-Wreturn-type] ../Linux/SimpleAudioEngine.cpp: In function ‘unsigned int CocosDenshion::_Hash(const char*)’: ../Linux/SimpleAudioEngine.cpp:135:1: warning: no return statement in function returning non-void [-Wreturn-type] g++ -Wall -g -O2 -I.. -I../include -I../third_party/fmod/api/inc -DLINUX ../Linux/FmodAudioPlayer.o ../Linux/SimpleAudioEngine.o -shared -o libcocosdenshion.so -L../third_party/fmod/api/lib -lfmodex /usr/bin/ld: ../Linux/FmodAudioPlayer.o: relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
…/Linux/FmodAudioPlayer.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libcocosdenshion.so] Error 1
cp: cannot stat `libcocosdenshion.so’: No such file or directory
building Box2D
*******
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2BroadPhase.cpp -o …/Collision/b2BroadPhase.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2CollideCircle.cpp -o …/Collision/b2CollideCircle.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2CollidePolygon.cpp -o …/Collision/b2CollidePolygon.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2Collision.cpp -o …/Collision/b2Collision.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2Distance.cpp -o …/Collision/b2Distance.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2DynamicTree.cpp -o …/Collision/b2DynamicTree.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/b2TimeOfImpact.cpp -o …/Collision/b2TimeOfImpact.o
…/Collision/b2TimeOfImpact.cpp: In member function ‘float32 b2SeparationFunction::Evaluate(int32, int32, float32) const’:
…/Collision/b2TimeOfImpact.cpp:200:12: warning: variable ‘axisA’ set but not used [-Wunused-but-set-variable]
…/Collision/b2TimeOfImpact.cpp:201:12: warning: variable ‘axisB’ set but not used [-Wunused-but-set-variable]
…/Collision/b2TimeOfImpact.cpp:218:12: warning: variable ‘axisB’ set but not used [-Wunused-but-set-variable]
…/Collision/b2TimeOfImpact.cpp:232:12: warning: variable ‘axisA’ set but not used [-Wunused-but-set-variable]
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/Shapes/b2CircleShape.cpp -o …/Collision/Shapes/b2CircleShape.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Collision/Shapes/b2PolygonShape.cpp -o …/Collision/Shapes/b2PolygonShape.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Common/b2BlockAllocator.cpp -o …/Common/b2BlockAllocator.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Common/b2Math.cpp -o …/Common/b2Math.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Common/b2Settings.cpp -o …/Common/b2Settings.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Common/b2StackAllocator.cpp -o …/Common/b2StackAllocator.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/b2Body.cpp -o …/Dynamics/b2Body.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/b2ContactManager.cpp -o …/Dynamics/b2ContactManager.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/b2Fixture.cpp -o …/Dynamics/b2Fixture.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/b2Island.cpp -o …/Dynamics/b2Island.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/b2World.cpp -o …/Dynamics/b2World.o
…/Dynamics/b2World.cpp: In member function ‘void b2World::SolveTOI(b2Body*)’:
…/Dynamics/b2World.cpp:694:7: warning: variable ‘solved’ set but not used [-Wunused-but-set-variable]
…/Dynamics/b2World.cpp: In member function ‘void b2World::DrawShape(b2Fixture*, const b2Transform&, const b2Color&)’:
…/Dynamics/b2World.cpp:900:9: warning: enumeration value ‘e_unknown’ not handled in switch [-Wswitch]
…/Dynamics/b2World.cpp:900:9: warning: enumeration value ‘e_typeCount’ not handled in switch [-Wswitch]
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/b2WorldCallbacks.cpp -o …/Dynamics/b2WorldCallbacks.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Contacts/b2CircleContact.cpp -o …/Dynamics/Contacts/b2CircleContact.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Contacts/b2Contact.cpp -o …/Dynamics/Contacts/b2Contact.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Contacts/b2ContactSolver.cpp -o …/Dynamics/Contacts/b2ContactSolver.o
…/Dynamics/Contacts/b2ContactSolver.cpp: In member function ‘bool b2ContactSolver::SolvePositionConstraints(float32)’:
…/Dynamics/Contacts/b2ContactSolver.cpp:598:95: warning: ‘psm.b2PositionSolverManifold::separation’ may be used uninitialized in this function [-Wuninitialized]
…/…/Box2D/Common/b2Math.h:436:36: warning: ‘((void)(& psm)+8).b2Vec2::y’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2ContactSolver.cpp:584:29: note: ‘((void)(& psm)+8).b2Vec2::y’ was declared here
…/…/Box2D/Common/b2Math.h:436:36: warning: ‘((void)(& psm)+8).b2Vec2::x’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2ContactSolver.cpp:584:29: note: ‘((void)(& psm)+8).b2Vec2::x’ was declared here
…/…/Box2D/Common/b2Math.h:441:32: warning: ‘psm.b2Vec2::y’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2ContactSolver.cpp:584:29: note: ‘psm.b2Vec2::y’ was declared here
…/…/Box2D/Common/b2Math.h:441:32: warning: ‘psm.b2Vec2::x’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2ContactSolver.cpp:584:29: note: ‘psm.b2Vec2::x’ was declared here
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Contacts/b2PolygonAndCircleContact.cpp -o …/Dynamics/Contacts/b2PolygonAndCircleContact.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Contacts/b2PolygonContact.cpp -o …/Dynamics/Contacts/b2PolygonContact.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Contacts/b2TOISolver.cpp -o …/Dynamics/Contacts/b2TOISolver.o
…/Dynamics/Contacts/b2TOISolver.cpp: In constructor ‘b2TOISolver::b2TOISolver(b2StackAllocator*)’:
…/Dynamics/Contacts/b2TOISolver.cpp:41:12: warning: converting to non-pointer type ‘int32 {aka int}’ from NULL [-Wconversion-null]
…/Dynamics/Contacts/b2TOISolver.cpp: In member function ‘bool b2TOISolver::Solve(float32)’:
…/Dynamics/Contacts/b2TOISolver.cpp:206:95: warning: ‘psm.b2TOISolverManifold::separation’ may be used uninitialized in this function [-Wuninitialized]
…/…/Box2D/Common/b2Math.h:436:36: warning: ‘((void)(& psm)+8).b2Vec2::y’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2TOISolver.cpp:192:24: note: ‘((void)(& psm)+8).b2Vec2::y’ was declared here
…/…/Box2D/Common/b2Math.h:436:36: warning: ‘((void)(& psm)+8).b2Vec2::x’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2TOISolver.cpp:192:24: note: ‘((void)(& psm)+8).b2Vec2::x’ was declared here
…/…/Box2D/Common/b2Math.h:441:32: warning: ‘psm.b2Vec2::y’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2TOISolver.cpp:192:24: note: ‘psm.b2Vec2::y’ was declared here
…/…/Box2D/Common/b2Math.h:441:32: warning: ‘psm.b2Vec2::x’ may be used uninitialized in this function [-Wuninitialized]
…/Dynamics/Contacts/b2TOISolver.cpp:192:24: note: ‘psm.b2Vec2::x’ was declared here
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2DistanceJoint.cpp -o …/Dynamics/Joints/b2DistanceJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2FrictionJoint.cpp -o …/Dynamics/Joints/b2FrictionJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2GearJoint.cpp -o …/Dynamics/Joints/b2GearJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2Joint.cpp -o …/Dynamics/Joints/b2Joint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2LineJoint.cpp -o …/Dynamics/Joints/b2LineJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2MouseJoint.cpp -o …/Dynamics/Joints/b2MouseJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2PrismaticJoint.cpp -o …/Dynamics/Joints/b2PrismaticJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2PulleyJoint.cpp -o …/Dynamics/Joints/b2PulleyJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2RevoluteJoint.cpp -o …/Dynamics/Joints/b2RevoluteJoint.o
g++ -Wall -g -O2 -I…/…/ -DLINUX -c …/Dynamics/Joints/b2WeldJoint.cpp -o …/Dynamics/Joints/b2WeldJoint.o
ar cr libbox2d.a …/Collision/b2BroadPhase.o …/Collision/b2CollideCircle.o …/Collision/b2CollidePolygon.o …/Collision/b2Collision.o …/Collision/b2Distance.o …/Collision/b2DynamicTree.o …/Collision/b2TimeOfImpact.o …/Collision/Shapes/b2CircleShape.o …/Collision/Shapes/b2PolygonShape.o …/Common/b2BlockAllocator.o …/Common/b2Math.o …/Common/b2Settings.o …/Common/b2StackAllocator.o …/Dynamics/b2Body.o …/Dynamics/b2ContactManager.o …/Dynamics/b2Fixture.o …/Dynamics/b2Island.o …/Dynamics/b2World.o …/Dynamics/b2WorldCallbacks.o …/Dynamics/Contacts/b2CircleContact.o …/Dynamics/Contacts/b2Contact.o …/Dynamics/Contacts/b2ContactSolver.o …/Dynamics/Contacts/b2PolygonAndCircleContact.o …/Dynamics/Contacts/b2PolygonContact.o …/Dynamics/Contacts/b2TOISolver.o …/Dynamics/Joints/b2DistanceJoint.o …/Dynamics/Joints/b2FrictionJoint.o …/Dynamics/Joints/b2GearJoint.o …/Dynamics/Joints/b2Joint.o …/Dynamics/Joints/b2LineJoint.o …/Dynamics/Joints/b2MouseJoint.o …/Dynamics/Joints/b2PrismaticJoint.o …/Dynamics/Joints/b2PulleyJoint.o …/Dynamics/Joints/b2RevoluteJoint.o …/Dynamics/Joints/b2WeldJoint.o
building chipmunk*****
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/chipmunk.c -o …/src/chipmunk.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpArbiter.c -o …/src/cpArbiter.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpArray.c -o …/src/cpArray.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpBB.c -o …/src/cpBB.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpBody.c -o …/src/cpBody.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpCollision.c -o …/src/cpCollision.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpHashSet.c -o …/src/cpHashSet.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpPolyShape.c -o …/src/cpPolyShape.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpShape.c -o …/src/cpShape.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpSpace.c -o …/src/cpSpace.o
…/src/cpSpace.c:31:0: warning: ignoring #pragma mark Contact [-Wunknown-pragmas]
…/src/cpSpace.c:61:0: warning: ignoring #pragma mark Collision [-Wunknown-pragmas]
…/src/cpSpace.c:80:0: warning: ignoring #pragma mark Misc [-Wunknown-pragmas]
…/src/cpSpace.c:95:0: warning: ignoring #pragma mark Memory [-Wunknown-pragmas]
…/src/cpSpace.c:214:0: warning: ignoring #pragma mark Collision [-Wunknown-pragmas]
…/src/cpSpace.c:277:0: warning: ignoring #pragma mark Body [-Wunknown-pragmas]
…/src/cpSpace.c:445:0: warning: ignoring #pragma mark Spatial [-Wunknown-pragmas]
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpSpaceComponent.c -o …/src/cpSpaceComponent.o
…/src/cpSpaceComponent.c:29:0: warning: ignoring #pragma mark Sleeping [-Wunknown-pragmas]
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpSpaceHash.c -o …/src/cpSpaceHash.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpSpaceQuery.c -o …/src/cpSpaceQuery.o
…/src/cpSpaceQuery.c:26:0: warning: ignoring #pragma mark Point [-Wunknown-pragmas]
…/src/cpSpaceQuery.c:73:0: warning: ignoring #pragma mark Segment [-Wunknown-pragmas]
…/src/cpSpaceQuery.c:157:0: warning: ignoring #pragma mark BB [-Wunknown-pragmas]
…/src/cpSpaceQuery.c:188:0: warning: ignoring #pragma mark Shape [-Wunknown-pragmas]
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpSpaceStep.c -o …/src/cpSpaceStep.o
…/src/cpSpaceStep.c:28:0: warning: ignoring #pragma mark Post [-Wunknown-pragmas]
…/src/cpSpaceStep.c:73:0: warning: ignoring #pragma mark Contact [-Wunknown-pragmas]
…/src/cpSpaceStep.c:144:0: warning: ignoring #pragma mark Collision [-Wunknown-pragmas]
…/src/cpSpaceStep.c:287:0: warning: ignoring #pragma mark All [-Wunknown-pragmas]
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/cpVect.c -o …/src/cpVect.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpConstraint.c -o …/src/constraints/cpConstraint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpDampedRotarySpring.c -o …/src/constraints/cpDampedRotarySpring.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpDampedSpring.c -o …/src/constraints/cpDampedSpring.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpGearJoint.c -o …/src/constraints/cpGearJoint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpGrooveJoint.c -o …/src/constraints/cpGrooveJoint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpPinJoint.c -o …/src/constraints/cpPinJoint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpPivotJoint.c -o …/src/constraints/cpPivotJoint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpRatchetJoint.c -o …/src/constraints/cpRatchetJoint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpRotaryLimitJoint.c -o …/src/constraints/cpRotaryLimitJoint.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpSimpleMotor.c -o …/src/constraints/cpSimpleMotor.o
gcc -Wall -g -O2 -std=c99 -I…/include/chipmunk -DLINUX -c …/src/constraints/cpSlideJoint.c -o …/src/constraints/cpSlideJoint.o
ar cr libchipmunk.a …/src/chipmunk.o …/src/cpArbiter.o …/src/cpArray.o …/src/cpBB.o …/src/cpBody.o …/src/cpCollision.o …/src/cpHashSet.o …/src/cpPolyShape.o …/src/cpShape.o …/src/cpSpace.o …/src/cpSpaceComponent.o …/src/cpSpaceHash.o …/src/cpSpaceQuery.o …/src/cpSpaceStep.o …/src/cpVect.o …/src/constraints/cpConstraint.o …/src/constraints/cpDampedRotarySpring.o …/src/constraints/cpDampedSpring.o …/src/constraints/cpGearJoint.o …/src/constraints/cpGrooveJoint.o …/src/constraints/cpPinJoint.o …/src/constraints/cpPivotJoint.o …/src/constraints/cpRatchetJoint.o …/src/constraints/cpRotaryLimitJoint.o …/src/constraints/cpSimpleMotor.o …/src/constraints/cpSlideJoint.o @

And make:

@dany@dany-Veriton-X490G:~/cocos2d-x/HelloWorld/Linux$ make
g++ -Wall -g -O2 -I…/…/cocos2dx/platform/third_party/linux -I…/…/cocos2dx/include -I…/…/cocos2dx -I…/…/cocos2dx/platform -I…/…/CocosDenshion/include -I…/Classes/ -DLINUX -c main.cpp -o main.o
g++ -Wall -g -O2 -I…/…/cocos2dx/platform/third_party/linux -I…/…/cocos2dx/include -I…/…/cocos2dx -I…/…/cocos2dx/platform -I…/…/CocosDenshion/include -I…/Classes/ -DLINUX -c …/Classes/AppDelegate.cpp -o …/Classes/AppDelegate.o
g++ -Wall -g -O2 -I…/…/cocos2dx/platform/third_party/linux -I…/…/cocos2dx/include -I…/…/cocos2dx -I…/…/cocos2dx/platform -I…/…/CocosDenshion/include -I…/Classes/ -DLINUX -c …/Classes/HelloWorldScene.cpp -o …/Classes/HelloWorldScene.o
g++ -Wall -g -O2 -I…/…/cocos2dx/platform/third_party/linux -I…/…/cocos2dx/include -I…/…/cocos2dx -I…/…/cocos2dx/platform -I…/…/CocosDenshion/include -I…/Classes/ -DLINUX ./main.o …/Classes/AppDelegate.o …/Classes/HelloWorldScene.o -o HelloWorld -L…/…/lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,…/…/lib/linux/Debug/
/usr/bin/ld: cannot find -lcocos2d
/usr/bin/ld: cannot find -lcocosdenshion
collect2: ld returned 1 exit status
make: *** [HelloWorld] Error 1@

…/include/CCMutableArray.h:130:18: error: ‘NULL’ was not declared in this scope
can not be used when making a shared object; recompile with -fPIC

It seems that your g++ is error.
Did you build under linux? My environment is ubuntu11.04, it works ok.

11.10 beta 2 all latest updates.

I’ll try updating G++ or something.

edit:
nope no help, also according to the internet the error means http://stackoverflow.com/questions/462165/error-null-was-not-declared-in-this-scope

So any ideas, is it an issue on my side?

Still doesn’t work, same errors :frowning: Come on it’s been almost 2 weeks since I’ve discovered cocos2d-x, I wanna try it out already, I’m losing the enthusiasm here =/

EDIT:
I’ve added #include <cstddef> to every file it errored, here’s the log:

**********************building cocos2dx************************** g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../cocoa/CCSet.cpp -o ../cocoa/CCSet.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../cocoa/CCZone.cpp -o ../cocoa/CCZone.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../effects/CCGrabber.cpp -o ../effects/CCGrabber.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../effects/CCGrid.cpp -o ../effects/CCGrid.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../keypad_dispatcher/CCKeypadDelegate.cpp -o ../keypad_dispatcher/CCKeypadDelegate.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../keypad_dispatcher/CCKeypadDispatcher.cpp -o ../keypad_dispatcher/CCKeypadDispatcher.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../label_nodes/CCLabelAtlas.cpp -o ../label_nodes/CCLabelAtlas.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../label_nodes/CCLabelBMFont.cpp -o ../label_nodes/CCLabelBMFont.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../label_nodes/CCLabelTTF.cpp -o ../label_nodes/CCLabelTTF.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../layers_scenes_transitions_nodes/CCLayer.cpp -o ../layers_scenes_transitions_nodes/CCLayer.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../layers_scenes_transitions_nodes/CCScene.cpp -o ../layers_scenes_transitions_nodes/CCScene.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../layers_scenes_transitions_nodes/CCTransition.cpp -o ../layers_scenes_transitions_nodes/CCTransition.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp -o ../layers_scenes_transitions_nodes/CCTransitionPageTurn.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../layers_scenes_transitions_nodes/CCTransitionRadial.cpp -o ../layers_scenes_transitions_nodes/CCTransitionRadial.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../menu_nodes/CCMenu.cpp -o ../menu_nodes/CCMenu.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../menu_nodes/CCMenuItem.cpp -o ../menu_nodes/CCMenuItem.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../misc_nodes/CCMotionStreak.cpp -o ../misc_nodes/CCMotionStreak.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../misc_nodes/CCProgressTimer.cpp -o ../misc_nodes/CCProgressTimer.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../misc_nodes/CCRenderTexture.cpp -o ../misc_nodes/CCRenderTexture.o ../include/CCRenderTexture.h: In constructor ‘cocos2d::CCRenderTexture::CCRenderTexture()’: ../include/CCRenderTexture.h:119:15: warning: ‘cocos2d::CCRenderTexture::m_ePixelFormat’ will be initialized after [-Wreorder] ../include/CCRenderTexture.h:118:14: warning: ‘cocos2d::CCImage* cocos2d::CCRenderTexture::m_pUITextureImage’ [-Wreorder] ../misc_nodes/CCRenderTexture.cpp:39:1: warning: when initialized here [-Wreorder] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../misc_nodes/CCRibbon.cpp -o ../misc_nodes/CCRibbon.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../particle_nodes/CCParticleExamples.cpp -o ../particle_nodes/CCParticleExamples.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../particle_nodes/CCParticleSystem.cpp -o ../particle_nodes/CCParticleSystem.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../particle_nodes/CCParticleSystemQuad.cpp -o ../particle_nodes/CCParticleSystemQuad.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCCommon.cpp -o ../platform/CCCommon.o ../platform/CCCommon.cpp: In function ‘void cocos2d::CCLog(const char*, ...)’: ../platform/CCCommon.cpp:208:12: warning: format not a string literal and no format arguments [-Wformat-security] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCFileUtils.cpp -o ../platform/CCFileUtils.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCGL.cpp -o ../platform/CCGL.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCImage.cpp -o ../platform/CCImage.o ../platform/CCImage.cpp: In member function ‘bool cocos2d::CCImage::_initWithPngData(void*, int)’: ../platform/CCImage.cpp:258:35: warning: ‘png_info_struct::color_type’ is deprecated (declared at ../platform/third_party/linux/libpng/png.h:669) [-Wdeprecated-declarations] ../platform/CCImage.cpp:258:35: warning: ‘png_info_struct::color_type’ is deprecated (declared at ../platform/third_party/linux/libpng/png.h:669) [-Wdeprecated-declarations] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCSAXParser.cpp -o ../platform/CCSAXParser.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCStdC.cpp -o ../platform/CCStdC.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/CCThread.cpp -o ../platform/CCThread.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/platform.cpp -o ../platform/platform.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/Linux/CCAplication_linux.cpp -o ../platform/Linux/CCAplication_linux.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/Linux/CCEGLView_linux.cpp -o ../platform/Linux/CCEGLView_linux.o ../platform/Linux/CCEGLView_linux.cpp: In function ‘bool initExtensions()’: ../platform/Linux/CCEGLView_linux.cpp:39:9: warning: unused variable ‘p’ [-Wunused-variable] ../platform/Linux/CCEGLView_linux.h: In constructor ‘cocos2d::CCEGLView::CCEGLView()’: ../platform/Linux/CCEGLView_linux.h:89:8: warning: ‘cocos2d::CCEGLView::m_fScreenScaleFactor’ will be initialized after [-Wreorder] ../platform/Linux/CCEGLView_linux.h:87:7: warning: ‘bool cocos2d::CCEGLView::bIsInit’ [-Wreorder] ../platform/Linux/CCEGLView_linux.cpp:83:1: warning: when initialized here [-Wreorder] ../platform/Linux/CCEGLView_linux.cpp: In member function ‘int cocos2d::CCEGLView::setDeviceOrientation(int)’: ../platform/Linux/CCEGLView_linux.cpp:301:1: warning: no return statement in function returning non-void [-Wreturn-type] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/Linux/CCFileUtils_Linux.cpp -o ../platform/Linux/CCFileUtils_Linux.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../platform/Linux/CCImage_Linux.cpp -o ../platform/Linux/CCImage_Linux.o ../platform/Linux/CCImage_Linux.cpp: In member function ‘void cocos2d::BitmapDC::buildLine(std::stringstream&, FT_Face, int, char)’: ../platform/Linux/CCImage_Linux.cpp:60:40: warning: suggest parentheses around ‘-’ inside ‘>>’ [-Wparentheses] ../platform/Linux/CCImage_Linux.cpp: In member function ‘bool cocos2d::BitmapDC::getBitmap(const char*, int, int, cocos2d::CCImage::ETextAlign, const char*, float)’: ../platform/Linux/CCImage_Linux.cpp:207:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../script_support/CCScriptSupport.cpp -o ../script_support/CCScriptSupport.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../sprite_nodes/CCAnimation.cpp -o ../sprite_nodes/CCAnimation.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../sprite_nodes/CCAnimationCache.cpp -o ../sprite_nodes/CCAnimationCache.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../sprite_nodes/CCSprite.cpp -o ../sprite_nodes/CCSprite.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../sprite_nodes/CCSpriteBatchNode.cpp -o ../sprite_nodes/CCSpriteBatchNode.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../sprite_nodes/CCSpriteFrame.cpp -o ../sprite_nodes/CCSpriteFrame.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../sprite_nodes/CCSpriteFrameCache.cpp -o ../sprite_nodes/CCSpriteFrameCache.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/CCArray.cpp -o ../support/CCArray.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/CCPointExtension.cpp -o ../support/CCPointExtension.o ../support/CCPointExtension.cpp: In function ‘float cocos2d::clampf(float, float, float)’: ../support/CCPointExtension.cpp:72:9: warning: variable ‘ftmp’ set but not used [-Wunused-but-set-variable] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/CCProfiling.cpp -o ../support/CCProfiling.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/CCUserDefault.cpp -o ../support/CCUserDefault.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/TransformUtils.cpp -o ../support/TransformUtils.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/base64.cpp -o ../support/base64.o ../support/base64.cpp: In function ‘int cocos2d::_base64Decode(unsigned char*, unsigned int, unsigned char*, unsigned int*)’: ../support/base64.cpp:67:2: warning: ‘c’ may be used uninitialized in this function [-Wuninitialized] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/ccUtils.cpp -o ../support/ccUtils.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/image_support/TGAlib.cpp -o ../support/image_support/TGAlib.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/zip_support/ZipUtils.cpp -o ../support/zip_support/ZipUtils.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/zip_support/ioapi.cpp -o ../support/zip_support/ioapi.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../support/zip_support/unzip.cpp -o ../support/zip_support/unzip.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../text_input_node/CCIMEDispatcher.cpp -o ../text_input_node/CCIMEDispatcher.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../text_input_node/CCTextFieldTTF.cpp -o ../text_input_node/CCTextFieldTTF.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../textures/CCTexture2D.cpp -o ../textures/CCTexture2D.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../textures/CCTextureAtlas.cpp -o ../textures/CCTextureAtlas.o ../include/CCTextureAtlas.h: In constructor ‘cocos2d::CCTextureAtlas::CCTextureAtlas()’: ../include/CCTextureAtlas.h:66:2: warning: ‘cocos2d::CCTextureAtlas::m_pQuads’ will be initialized after [-Wreorder] ../include/CCTextureAtlas.h:56:10: warning: ‘bool cocos2d::CCTextureAtlas::m_bDirty’ [-Wreorder] ../textures/CCTextureAtlas.cpp:43:1: warning: when initialized here [-Wreorder] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../textures/CCTextureCache.cpp -o ../textures/CCTextureCache.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../textures/CCTexturePVR.cpp -o ../textures/CCTexturePVR.o ../textures/CCTexturePVR.cpp: In member function ‘bool cocos2d::CCTexturePVR::initWithContentsOfFile(const char*)’: ../textures/CCTexturePVR.cpp:439:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../textures/CCTexturePVR.cpp:443:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../tileMap_parallax_nodes/CCParallaxNode.cpp -o ../tileMap_parallax_nodes/CCParallaxNode.o g++ -Wall -g -O2 -I.. -I../platform/third_party/linux/libfreetype2 -I../include -I../platform -I../platform/third_party/linux/libpng -I../platform/third_party/linux/libxml2 -I../platform/third_party/linux/libjpeg -DLINUX -c ../tileMap_parallax_nodes/CCTMXLayer.cpp -o ../tileMap_parallax_nodes/CCTMXLayer.o ../tileMap_parallax_nodes/CCTMXLayer.cpp: In member function ‘cocos2d::CCSprite* cocos2d::CCTMXLayer::insertTileForGID(unsigned int, const cocos2d::CCPoint&)’: ../tileMap_parallax_nodes/CCTMXLayer.cpp:296:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ../tileMap_parallax_nodes/CCTMXLayer.cpp: In member function ‘cocos2d::CCSprite* cocos2d::CCTMXLayer::appendTileForGID(unsigned int, const cocos2d::CCPoint&)’: ../tileMap_parallax_nodes/CCTMXLayer.cpp:382:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ../tileMap_parallax_nodes/CCTMXLayer.cpp: In member function ‘unsigned int cocos2d::CCTMXLayer::atlasIndexForExistantZ(unsigned int)’: ../tileMap_parallax_nodes/CCTMXLayer.cpp:399:21: error: cast from ‘int*’ to ‘int’ loses precision [-fpermissive] ../tileMap_parallax_nodes/CCTMXLayer.cpp:399:53: error: cast from ‘void**’ to ‘int’ loses precision [-fpermissive] ../tileMap_parallax_nodes/CCTMXLayer.cpp: In member function ‘unsigned int cocos2d::CCTMXLayer::atlasIndexForNewZ(int)’: ../tileMap_parallax_nodes/CCTMXLayer.cpp:408:45: error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive] ../tileMap_parallax_nodes/CCTMXLayer.cpp: In member function ‘virtual void cocos2d::CCTMXLayer::removeChild(cocos2d::CCNode*, bool)’: ../tileMap_parallax_nodes/CCTMXLayer.cpp:475:70: error: cast from ‘void*’ to ‘unsigned int’ loses precision [-fpermissive] make: *** [../tileMap_parallax_nodes/CCTMXLayer.o] Error 1 cp: cannot stat `libcocos2d.so': No such file or directory **********************building cocosdenshion********************* g++ -Wall -g -O2 -I.. -I../include -I../third_party/fmod/api/inc -DLINUX ../Linux/FmodAudioPlayer.o ../Linux/SimpleAudioEngine.o -shared -o libcocosdenshion.so -L../third_party/fmod/api/lib -lfmodex /usr/bin/ld: ../Linux/FmodAudioPlayer.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC ../Linux/FmodAudioPlayer.o: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [libcocosdenshion.so] Error 1 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.

I build it just now, it is ok.
Did you do any changes by yourself?
My ubuntu is 32 bit, I have not tested it in 64 bit, but I some developer told me it can not work on 64 bit.

Installing 32b at the moment, thank you.

I give up, nothing ever works. And the tutorial sucks. It’s outdated and tells nothing. Just points to sites that say nothing too. And the 32b ubuntu 11.10 is even worser. It feels like it’s twice slower and three times less stable… I’ll try win32, that’s going to work at least. Though I hate cygwin…

Oh, what a pity.
Which tutorial did you read?

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_HelloWorld_and_tests_on_linux

http://blog.plicatibu.com/developing-with-cocos2d-x-for-android-on-linux/

http://htcdev.com/devcenter/opensense-sdk/quick-guide

http://developer.android.com/sdk/index.html

1.) How to install SDK.

Unzip.

Add to path. Every tutorial describes it differently. So I did everything .’ And I had to figure out how to add to path myself. Plus ubuntu has different files to save it to…

2.) How to install NDK.

Unzip.

Add to path. What? Where? Only one tutorial says it… I don’t know if it works. Plus I’ve never defined $NDK yet it mentions it. Plus turns out later I need more of the paths defined.

3.) Install JDK.

Choose OpenJDK or JDK… OpenJDK apparently doesn’t work good so

Unzip.

Leave alone?
4.) Install cocos2d-x
Build fails. No matter if 64b or 32b same errors.
Make?
Import into eclipse?


Why do I import into eclipse just to compile? Where do I write the game in? Shouldn’t it all be in the same project in Eclipse?

?5.)? Set up debugging in eclipse???

-Errors right away….

Just… nothing works… I just wish cocos2d-x came in one package and I’d just start right away…

Installing NDK development environment is the same on different platforms.
You can do it following google docs.

I think you can only read
[[http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_HelloWorld_and_tests_on_linux]]

This doc describes how to run app on linux(just like running on windows), and how to run app on Android simulator.

Hello,

I have been able to simply fix the problem by adding some missing includes. I do believe that the new version of G++ is less tolerant for Ubuntu 11.10 than the one for ubuntu 10.4 about such of mistake.

I enclosed the patch to this message. Everything is working fine for me after using this patch.

Great work by the way for the linux port :slight_smile:

Thank you, I will change it.
#780 is created for it.

Oh thank you so much, will try ASAP!

EDIT:
Wait but I already did that and it still errored a lot.

EDIT2:
Thank you, on 32bit it finally works.

EDIT3:
OK on Eclipse the tests don’t compile because it can’t find
#include <jni.h> #include <android/log.h>

I have JAVA_HOME and android sdk/ndk in path, why can’t it find it?

EDIT4:
I’ve gone into project preferences -> linked resources and added all the folders needed incl. the ones that contain that lost headers, but it still can’t find it =/

@
Description Resource Path Location Type
fatal error: jni.h: Adresář nebo soubor neexistuje main.cpp /cocos2dx-test/test.android/jni/tests line 3 C/C++ Problem
Invalid arguments ‘
Candidates are:
void setFrameWidthAndHeight(int, int)
’ main.cpp /cocos2dx-test/test.android/jni/tests line 19 Semantic Error
make: **** Error 1 cocos2dx-test C/C++ Problem
Type ‘jint’ could not be resolved main.cpp /cocos2dx-test/test.android/jni/tests line 14 Semantic Error
Type ‘jint’ could not be resolved main.cpp /cocos2dx-test/test.android/jni/tests line 14 Semantic Error
Type ‘JNIEnv’ could not be resolved main.cpp /cocos2dx-test/test.android/jni/tests line 14 Semantic Error
Type ‘jobject’ could not be resolved main.cpp /cocos2dx-test/test.android/jni/tests line 14 Semantic Error@

Adresář nebo soubor neexistuje means folder or file doesn’t exist.
EDIT5:
OK I’ve excluded main.cpp from the build and it builds. Not all tests run properly though.
EDIT6:
Right click on include -> Open Declaration… it found jni.h… what the**? But in jni.h it doesn’t find jni_md.h? I still don’t get it, building it can’t find jni.h when eclipse quite certainly found it and found a bug in it? What’s wrong again???

EDIT7:
Also why is HelloWorld/Android excluded from build? Now that I’ve opened it it errors too?

Isn’t the whole point of this making an android game without the need to run it in emulator? Then why is the android build excluded from build? :frowning:

I don’t know, can you at least suggest what paths could I be missing?

Did you follow [[How_to_run_HelloWorld_and_tests_on_linux]]?