2

この小さな例をコンパイルしようとすると 、make の実行中に次のエラーが発生します。

g++ -o ogl_cs_example main.cpp opengl_cs.cpp opengl_util.cpp -Wall -Iinclude -lX11 -lGL -lGLU
/tmp/ccFLIOt2.o: In function `updateTex(int)':
main.cpp:(.text+0xc6): undefined reference to `glDispatchCompute'
/tmp/ccQ8pShN.o: In function `genTexture()':
opengl_util.cpp:(.text+0x3df): undefined reference to `glBindImageTexture'
/tmp/ccQ8pShN.o: In function `initGL()':
opengl_util.cpp:(.text+0x7dd): undefined reference to `glXCreateContextAttribsARB'
collect2: error: ld returned 1 exit status
make: *** [example] Error 1

私は何が欠けていますか?

4

3 に答える 3

0

未定義の参照は、ライブラリにリンクしていないことを意味します

于 2014-01-24T18:12:45.930 に答える
0

何かをリンクするのを忘れています。GLEW を使用している場合は、glew32.lib (またはシステムの libglew32.a など) にリンクしていることを確認してください。

于 2014-01-24T18:18:23.420 に答える