0
我在Linux(Ubuntu 13.10)中使用OpenGL開始一個項目,並且我的教授在他的計算機中編譯了一個基本的源代碼。C在Ubuntu 13.10中編譯錯誤,可能是makefile中的錯誤
當我TREID這裏編譯它,(我在其他項目的工作的Open GL庫),我得到了在終端以下錯誤:
gcc -o quadtree quadtree.o glm.o winGL.o -lglut -lGL -lGLU
/usr/bin/ld: glm.o: referência indefinida ao símbolo '[email protected]@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: ** [quadtree] Erro 1
( 「referênciaindefinida AO simbolo」 的意思是「未定義參考符號「)
我在互聯網搜索,並得到提示,這可能是一個錯誤的生成文件,但我不知道什麼是錯的。有我的生成文件:
.c.o: $*.h
gcc -c $*.c
.cpp.o: $*.h
g++ -c $*.cpp
all: quadtree
quadtree: quadtree.o glm.o winGL.o
gcc -o [email protected] $^ -lglut -lGL -lGLU
clean:
rm *.o *.*~ *~ quadtree
是否有任何命令丟失?
你應該提高你的'Makefile';見例如[這個例子](http://stackoverflow.com/a/14180540/841108)或[這一個](http://stackoverflow.com/a/20146082/841108) –