Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld: symbol(s) not found for architecture x86_64 (Xcode 4) // opengles.o

I'm making an xcode command tool application with external libraries and got some errors.

what i tried to resovle them :

  • Build with different compiler
  • remove The GLES folder and add it again
  • Build it on 32 and 64

Am i missing something regarding the opengles.cpp ?

If you got any idea what can be done next please say so, below you can find all the info regarding the project and error. If you need more info i'm happy to assist you. Also if you know how to get the NiUsertracker sample from opnni compiled in xcode 4, it would also be a great help to solve this problem

The error :

enter image description here

The problem might have something to do with these files :

enter image description here

The info of the project setting (it's a command line tool not an app) :

enter image description here

Screenshot of the output when building

enter image description here

The build settings

enter image description here

like image 931
Olivier_s_j Avatar asked Nov 04 '11 18:11

Olivier_s_j


3 Answers

Usually when I get those kinds of errors, It's because I forgot to link with the library. The folder you got contains only headers; try to find the framework for OpenGL ES. (I think Xcode comes with a GLES framework, try searching.)

like image 141
Bob Avatar answered Nov 15 '22 13:11

Bob


Run the commands manually in a terminal (Terminal.app) to find out exactly what the problem is:

[ 11:56 jon@hozbox ~ ]$ Ld /Users/olivierjanssens/Library/Developer/Xcode/DerivedData/scene-anlidnesspxdbhblrrwqfwybphqj/Build/Products/Debug/scene normal x86_64
[ 11:56 jon@hozbox ~ ]$ cd /Users/olivierjanssens/Documents/xcode/scene
[ 11:56 jon@hozbox ~ ]$ setenv MACOSX_DEPLOYMENT_TARGET 10.7
[ 11:56 jon@hozbox ~ ]$ /Developer/usr/bin/llvm-g++-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/olivierjanssens/Library/Developer/Xcode/DerivedData/scene-anlidnesspxdbhblrrwqfwybphqj/Build/Products/Debug -L/Users/olivierjanssens/Documents/xcode/scene/Libs -F/Users/olivierjanssens/Library/Developer/Xcode/DerivedData/scene-anlidnesspxdbhblrrwqfwybphqj/Build/Products/Debug -filelist /Users/olivierjanssens/Library/Developer/Xcode/DerivedData/scene-anlidnesspxdbhblrrwqfwybphqj/Build/Intermediates/scene.build/Debug/scene.build/Objects-normal/x86_64/scene.LinkFileList -mmacosx-version-min=10.7 /usr/lib/libnimCodecs.dylib /usr/lib/libnimMockNodes.dylib /usr/lib/libnimRecorder.dylib /usr/lib/libOpenNI.dylib /usr/lib/libXnVFeatures.dylib /usr/lib/libXnVHandGenerator.dylib -framework GLUT -framework OpenGL /Users/olivierjanssens/Documents/xcode/scene/Libs/glut64.lib -o

After running the last command (/Developer/usr/bin/llvm-g++-4.2), it will show the reason for failing.

If the setenv MACOSX_DEPLOYMENT_TARGET 10.7 command fails, replace setenv with export and put an = before the 10.7 like this:

[ 11:56 jon@hozbox ~ ]$ export MACOSX_DEPLOYMENT_TARGET="10.7"

It seems like your missing a setting for your build configuration. Possibly the app name (MyApp.app). Check to make sure your not missing anything from the "Info" tab in the project settings window (just click the top item from the list of files on the left).

From llvm-gcc man page:

-o filename Specify the output file to be filename.

like image 23
chown Avatar answered Nov 15 '22 14:11

chown


remove the framework.And add it again.Quit the Xcode and relaunch it.

like image 36
Tendulkar Avatar answered Nov 15 '22 14:11

Tendulkar