The library I am trying to use is NiTE2, I have successfully include & linked OPENNI2 and the libfreenect driver. Here is the error message:
dyld: Library not loaded: libNiTE2.dylib
Referenced from: /Users/yangwang/Documents/cinder_projects/basic/xcode/build/Debug/basic.app/Contents/MacOS/basic
Reason: image not found
NOTE: There are quite a few similar questions regarding the same error messages. but none of them helped my case.
A few things I already tried but not working:
I have tried adding the dylib file into Embedded Binaries like this one suggested: dyld: Library not loaded, Reason: image not found
I also made sure I have included the correct search path for the lib, and properly set it up in Library Search Path, like this one suggested: Eclipse on Mac dyld: Library not loaded: Image not found
All openni2 and libfreenect related dylibs are being found with no problem.
Here are images of my settings:
XCode v: 9.3.1 Mac os v: 10.13.4
----UPDATE-----
I added some Copy Files settings into Build Phase, screenshot here, including everything inside my include and lib folder. This didn't solve my problem ( yet ). Then, after build, I went myapp.app/Contents/MacOS
and used ./myapp
to run the build. And it magically runs and found all libraries! I don't quite understand why though, hope someone can explain.