OF 0.9.0 with Xcode 0.72 compile ofxOpenNI errors - ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hello,
I am new to open frameworks, I am trying to run kinect with OpenNI to get the skeleton data.
I downloaded ofxOpenNI from gameoverhack’s Github. I managed to install the addon to my OF after solving all kinds of linking problems, then I occurred those errors which I have no idea how to solve it, please see below.
Can anyone help or direct me to a right path that I can solve this issue. I am using OF0.9.0 with Xcode 0.72 and OS X EI Capitan.
Many Thanks.

Below are the error message:

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks//QuickTime.framework/QuickTime.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks//QuickTime.framework/QuickTime.tbd
Undefined symbols for architecture x86_64:
“ofxOpenNI::removeImageGenerator()”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::addInfraGenerator()”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::removeInfraGenerator()”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::getUseBackBuffer()”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::setUseBackBuffer(bool)”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::stop()”, referenced from:
ofApp::exit() in ofApp.o
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::isInfraOn()”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::getTrackedUser(int)”, referenced from:
ofApp::draw() in ofApp.o
“ofxOpenNI::setBaseUserClass(ofxOpenNIUser&)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNIUser::drawMask()”, referenced from:
ofApp::draw() in ofApp.o
“ofxOpenNI::isImageOn()”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNIUser::drawPointCloud()”, referenced from:
ofApp::draw() in ofApp.o
“ofxOpenNI::update()”, referenced from:
ofApp::update() in ofApp.o
“ofxOpenNI::~ofxOpenNI()”, referenced from:
ofApp::ofApp() in main.o
ofApp::~ofApp() in ofApp.o
“ofxOpenNI::addImageGenerator()”, referenced from:
ofApp::setup() in ofApp.o
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNI::drawDebug()”, referenced from:
ofApp::draw() in ofApp.o
“ofxOpenNI::setRegister(bool)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::setMirror(bool)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNIUser::setUseMaskTexture(bool)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::start()”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNIUser::setUsePointCloud(bool)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNIUser::setPointCloudResolution(int)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::setMaxNumUsers(int)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNIUser::ofxOpenNIUser()”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::getNumDevices()”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::getNumTrackedUsers()”, referenced from:
ofApp::draw() in ofApp.o
“ofxOpenNI::addUserGenerator()”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::setPointCloudResolutionAllUsers(int)”, referenced from:
ofApp::keyPressed(int) in ofApp.o
“ofxOpenNIUser::~ofxOpenNIUser()”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNIUser::setPointCloudDrawSize(int)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::setup(bool)”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::addDepthGenerator()”, referenced from:
ofApp::setup() in ofApp.o
“ofxOpenNI::ofxOpenNI()”, referenced from:
ofApp::ofApp() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am dealing with ofxOpenNI myself at the moment. I think this is the error when ofxOpenNI source files (ofxOpenNI.cpp and ofxOpenNITypes.cpp) are not included in Build Phases > Compile Sources.

Thanks for your reply,
I just added (ofxOpenNI.cpp and ofxOpenNITypes.cpp) into Build Phases>Compile Sources, before it was only 2 file(main.cpp and ofApp.cpp). However, the errors increased to 100+ with the same reason(Undefined symbols for architecture x86_64:), I also did some research, some said it’s the link problem in the Link Binary With Libraries section, before I only have 1(openFrameworksDebug.a), now I have 28,
then the error message become 1 which is:

ld: library not found for -lnimCodecs
clang: error: linker command failed with exit code 1 (use -v to see invocation)

not sure which part of the link has the problem…

Something is wrong, because nimCodecs.dll - is a Windows library, which is located in win/copy_to_data_openni_path folder, there is no such library in corresponding “mac” folder.

hmm… yeah… there is nimCodecs.dylib located in mac/copy_to_data_openni_path/bin folder as well. I think the problem is not just limited to this dylib, I tried to move the nimCodecs out of the folder then it shows missing nimMockNodes.dylib which is next to nimCodecs.dylib. So I assume to the link to the whole bin folder has problem. I also went to Library Search Paths to add the bin location. After I did that the error become see the attached image. So I am really confused and desperate not sure what to do…

May I know what kind of system are you running?

Make sure ofxOpenNI header files are included correctly. Class ofxOpenNIDepthThreshold (the error on your screenshot) is declared in ofxOpenNITypes.h.

I’m not a big pro myself, but I know that if there is “undefined symbols” error - that means that either libraries not added to project (*.dylib, *.a), or you don’t have header files added to project, which are: ofxOpenNI.h, ofxOpenNITypes.h, ofxOpenNIUtils.h. These headers should exist in your project three (on the left):
(your project) > addons > ofxOpenNI > src.

I also have the paths to ofxOpenNI header files in Build Settings > Search paths > Header Search Paths.

Not sure if these two things are both necessary, but I’m afraid to touch anything while it works.

Well, what the hell, will add my own screenshot :slight_smile:

All folders are set as “recursive”, just in case.

Hi Gonzzza,
Thanks for your quick reply :slight_smile: , in my file I can see fxOpenNI.h, ofxOpenNITypes.h, ofxOpenNIUtils.h in the [my project] > addons > ofxOpenNI > src folder, but not sure why the project can’t link to them.
In my path it use to be non-recursive but now I changed to recursive but still the error message is the same

By the way, how did you installed your add on? through git or you downloaded the folder then placed into the openframeworks addon?
Thank you

I installed addon from GIT. It is gameoverhack/ofxOpenNI, developer branch. Actually it doesn’t matter if you download/unzip or use GIT, because the addon has not been developed for a while, but make sure you’re using developer branch.

And then I manually edited files, and added this pull request:
https://github.com/gameoverhack/ofxOpenNI/pull/56, in this request there are some fixes, to get rid of errors and warnings in of 0.9. Because many things have changed and some functions are deprecated.

Hi Gonzzza,

sorry for the late reply I was sick the past whole week:(

I am not sure if I used developer branch or not, since I downloaded it and unzipped into it…

Hmm… I will try the link you attached because when I used the example from the ofxOpenNI, I would have random errors such as" Expect Expression" which pointing at a comment area… in one of the .h file. So I generated empty project and copy paste the example code into it which leads to the error I am having now.

If it’s not ask too much, would you mind send me one of your working example to me to let me try to see if it working on my laptop setup?

Many thanks

The problem is that i downloaded OF 0.9.2 from github, and now it is not compiling anymore… I get 12 errors. Most of them got something to do with threading (ofThread), Poco… probably there are some changes… have to investigate.

So I guess if i want my projects work forever - i need to have another copy of OF (which will be static, not updated).

Anyway - here is my project, should work with OF 0.9.0, it does not do anything at the moment, I’m figuring out how OpenNI works… skeletons, pointClouds etc… But you can check how my files are organised… Also there is a Release binary inside, so you can try to run it.

https://dl.dropboxusercontent.com/u/3214495/x_Skeleton.zip (433mb, copy the contents to your /apps/myApps folder).

Thanks Gonzzza,

I will have a look after I finish work today, hopefully it works on mine as well:), I only need the skeleton function… then I am going to try work that with Box2d…

Hmm… seems OpenNI is very picky about which version of OF is used. It happened to me before the ofThread error, mine is showing Expect Expression in some weird place when I using the OpenNI example. Before, I was thinking to use an old version OF and Xcode to complie the OpenNI, but I haven’t tried yet.

Hi Gonzzza,

Thanks for your code package… it seems that it working!! thank you! :slight_smile: I haven’t tested the skeleton tracking function but at the moment the kinect can detect images.

However, I have another question, when I first time compiling the example in the folder( except those linking errors ) after Xcode said build succeed, I have an error showing:

dyld: Library not loaded: ./libfmodex.dylib Referenced from: /Users/john/Documents/OF09/ofv09/apps/myApps/x_Skeleton/bin/x_Skeleton.app/Contents/MacOS/x_Skeleton Reason: image not found

then I found the thread from this link OF best practice for setting paths to .dylibs? I copied and pasted the suggestion code into the run script then the program runs, however in the output section on the right bottom it wrote:

[warning] ofxOpenNIDevice[0]: Using a NASTY hack to silence SIGNAL errors on exit - read the comments at line ~1712 of ofxOpenNI.cpp
[notice ] ofxOpenNIDevice[0]: Init context…
[verbose] ofxOpenNIDevice[0]: Context initilizedstatus:OK
[notice ] ofxOpenNIDevice[0]: openni driver version: 1.5.4.0
[notice ] ofxOpenNIDevice[0]: Adding licence…
[verbose] ofxOpenNIDevice[0]: Adding licence: PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=status:OK
[notice ] ofxOpenNIDevice[0]: Init device…
[verbose] ofxOpenNIDevice[0]: Enumerate devicesstatus:OK
[notice ] ofxOpenNIDevice[0]: Found1devices connected
[verbose] ofxOpenNIDevice[0]: Creating production tree for device 0status:OK
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_IMAGE
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_IMAGE generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Setting Image1 resolution: 640 x 480 at 30fpsstatus:OK
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_IMAGE generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Allocating image
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_DEPTH
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_DEPTH generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Setting Depth1 resolution: 640 x 480 at 30fpsstatus:OK
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_DEPTH generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Allocating depth
[verbose] ofxOpenNIDevice[0]: Register viewpoint depth to RGBstatus:OK
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_USER
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_USER generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_USER generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Allocating users
[notice ] ofxOpenNIDevice[0]: User generator DOES NOT require pose for calibration
[verbose] ofxOpenNIDevice[0]: Set skeleton profilestatus:OK
[notice ] ofxOpenNIDevice[0]: Starting ofxOpenNI with threading
[warning] ofThread: - name: Thread 1 - Calling startThread with verbose is deprecated.
ofxOpenNIDevice[0]: stop called
ofxOpenNIDevice[0]: trying to lock
ofxOpenNIDevice[0]: trying to stop thread
ofxOpenNIDevice[0]: releasing all nodes
ofxOpenNIDevice[0]: releasing depth generator
ofxOpenNIDevice[0]: releasing image generator
ofxOpenNIDevice[0]: releasing user generator
ofxOpenNIDevice[0]: releasing device
ofxOpenNIDevice[0]: releasing context
ofxOpenNIDevice[0]: releasing depth texture & pixels
ofxOpenNIDevice[0]: releasing image texture & pixels
ofxOpenNIDevice[0]: full stopped
ofxOpenNIDevice[0]: destructor called
ofxOpenNIDevice[0]: stop called

did this happen to yours?

Many thanks,

Hi I have this issue too but also dont know why :confused:

Hi Adamtth,
I am not sure either but when I download Gonzzza’s file it works for me, have you tried his link?

I’m getting the same error:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I’ve added /libs, /src and /include in addons/ofxOpenNI to the Header Search Paths, after switching to recursive it picks up the missing header, but then throws this error.

Running macOS 10.12.1, Xcode 8.1, oF 0.9.7 and using ofxOpenNI from Gonzzza’s fork: https://github.com/ccerhan/ofxOpenNI

Don’t have that much experience with these kind if issues, so any help would be greatly appreciated

Maybe this can help you

OSX 10.11 + Xcode 7.0.1 + OF 0.9.8:

I just opened ofxOpenNi_examples.xcodeproj in Xcode and I compiled/run without any problems.

Then I used projectGenerator to update some projects that I made with ofxOpenNI but I get linker problems. Maybe you could copy the ofxOpenNi_examples.xcodeproj settings and pasting in to a new project