我目前正按时使用 kinect openNi 和 NITE。事实上,我检测到手的位置,例如手是否在你的头上?为此,我需要更改 NITE 的 PointViewer。
但是,当我修改代码时无法编译。
事实上,当我在文件 PointViewer 中进行制作时,如果有错误,编译器会将它们全部报告给我,但是当我接近更正时,我发现书店的未定义参考错误实际上 Glut 就像他没有被包括在内,而对我来说,这是因为在 PointViewer 修改代码之前有效。
我已经安装了 freeglut3-dev 并包含了库和 . 如您所说,在建立链接时会出现问题。是否有任何编译器选项可以使链接成功?如何在 makefile 中添加编译器选项以便它可以找到 GLU 库在哪里?
你知道这可能是什么吗?
在这里我要注意:
g++ -o ../Bin/x64-Release/Sample-PointViewer ./x64-Release/main.o ./x64-Release/PointDrawer.o ./x64-Release/signal_catch.o -L../Bin/x64-Release -lglut -lOpenNI -lXnVNite_1_5_2
./x64-Release/main.o:main.cpp:function glutDisplay(): error: undefined reference to 'glClear'
./x64-Release/main.o:main.cpp:function glutDisplay(): error: undefined reference to 'glMatrixMode'
./x64-Release/main.o:main.cpp:function glutDisplay(): error: undefined reference to 'glPushMatrix'
./x64-Release/main.o:main.cpp:function glutDisplay(): error: undefined reference to 'glLoadIdentity'
./x64-Release/main.o:main.cpp:function glutDisplay(): error: undefined reference to 'glOrtho'
./x64-Release/main.o:main.cpp:function glutDisplay(): error: undefined reference to 'glDisable'
./x64-Release/main.o:main.cpp:function glInit(int*, char**): error: undefined reference to 'glDisable'
./x64-Release/main.o:main.cpp:function glInit(int*, char**): error: undefined reference to 'glEnable'
./x64-Release/main.o:main.cpp:function glInit(int*, char**): error: undefined reference to 'glEnableClientState'
./x64-Release/main.o:main.cpp:function glInit(int*, char**): error: undefined reference to 'glDisableClientState'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function initTexture(void**, int&, int&): error: undefined reference to 'glGenTextures'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function initTexture(void**, int&, int&): error: undefined reference to 'glBindTexture'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function initTexture(void**, int&, int&): error: undefined reference to 'glTexParameteri'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function initTexture(void**, int&, int&): error: undefined reference to 'glTexParameteri'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawRectangle(float, float, float, float): error: undefined reference to 'glVertexPointer'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawRectangle(float, float, float, float): error: undefined reference to 'glDrawArrays'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawRectangle(float, float, float, float): error: undefined reference to 'glFlush'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawTexture(float, float, float, float): error: undefined reference to 'glEnableClientState'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawTexture(float, float, float, float): error: undefined reference to 'glTexCoordPointer'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawDepthMap(xn::DepthMetaData const&): error: undefined reference to 'glBindTexture'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawDepthMap(xn::DepthMetaData const&): error: undefined reference to 'glTexImage2D'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawDepthMap(xn::DepthMetaData const&): error: undefined reference to 'glColor4f'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawDepthMap(xn::DepthMetaData const&): error: undefined reference to 'glEnable'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawFrameID(unsigned int): error: undefined reference to 'glColor4f'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawFrameID(unsigned int): error: undefined reference to 'glRasterPos2i'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glColor4f'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glPointSize'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glVertexPointer'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glDrawArrays'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glColor4f'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glPointSize'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glDrawArrays'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function XnVPointDrawer::Draw() const: error: undefined reference to 'glFlush'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function PrintSessionState(SessionState): error: undefined reference to 'glRasterPos2i'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function PrintSessionState(SessionState): error: undefined reference to 'pthread_create'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function PrintSessionState(SessionState): error: undefined reference to 'pthread_join'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawTexture(float, float, float, float): error: undefined reference to 'glDisableClientState'
./x64-Release/PointDrawer.o:PointDrawer.cpp:function DrawDepthMap(xn::DepthMetaData const&): error: undefined reference to 'glDisable'
collect2: ld returned 1 exit status
make: *** [../Bin/x64-Release/Sample-PointViewer] Error 1
提前致谢