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

36,676

Solution 1

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.)

Solution 2

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.

Solution 3

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

Share:
36,676
Olivier_s_j
Author by

Olivier_s_j

Updated on March 19, 2020

Comments

  • Olivier_s_j
    Olivier_s_j about 4 years

    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

  • chown
    chown over 12 years
    You might need to completly remove that egl framework from your project, then add it back in. Sometimes frameworks get de-linked in xcode for no reason.
  • Olivier_s_j
    Olivier_s_j over 12 years
    There is no egl framework. But there is a opengles.h file though. I removed all the files which i added to the project and then added them again. No difference . I added a screenshots of the folder with the files which i think might be responsible for the error.
  • chown
    chown over 12 years
    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).
  • Olivier_s_j
    Olivier_s_j over 12 years
    I'm not developping an app, it is a command line tool . And i can't change the name. Though a project name is set
  • chown
    chown over 12 years
    Can you include a screenshot or list of your build settings for the target? Just the "basic" view should be fine, not "all".
  • Olivier_s_j
    Olivier_s_j over 12 years
    ok i'ved added the screenshot, i also tried with another compiler
  • chown
    chown over 12 years
    It seems that there is an issue with the architecture you are building for and the glut32/64 libs. Whats your architecture build settings?
  • Olivier_s_j
    Olivier_s_j over 12 years
    Those are prebuild by openni/nite ,both are included and i've tried to build my project on 32 as 64 , both with the same results. I don't think that it has something to do with the architecture as the 2 versions are in the project (Even tried to compile it with them separately). My best guess is something with a library that is not included or added ... but i'm not sure
  • Olivier_s_j
    Olivier_s_j over 12 years
    It is not a framework but a folder from another project. I did like you said an removed the folder added it again restarted xcode. But i'm affraid there no difference
  • Jay Taylor
    Jay Taylor about 12 years
    This strategy solved my problem when I was seeing these errors. Thank you!