我用自己的 CMakeLists.txt 文件来构建 OpenNI 示例。我成功构建了 NiSimpleViewer。但是当尝试使用 NiUserTracker 我得到这个错误:
35 warnings generated.
Linking CXX executable main
ld: warning: path '/usr/lib/libOpenNI.dylib' following -L not a directory
Undefined symbols for architecture x86_64:
"DrawDepthMap(xn::DepthMetaData const&, xn::SceneMetaData const&)", referenced from:
glutDisplay() in main.cpp.o
"MyPoseInProgress(xn::PoseDetectionCapability&, char const*, unsigned int, XnPoseDetectionStatus, void*)", referenced from:
_main in main.cpp.o
"MyCalibrationInProgress(xn::SkeletonCapability&, unsigned int, XnCalibrationStatus, void*)", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
这是我使用的 CMakeLists。请告诉我它有什么问题?
build/ 外部文件夹的内容是
CMakeLists.txt Libs build opengles.cpp
GL SceneDrawer.cpp glh opengles.h
GLES SceneDrawer.h main.cpp