2013-08-24 39 views
0

當我嘗試對OpenGL庫作爲鏈接與gl3n錯誤

LANG=en dmd -debug -gc -unittest -D -Dd/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/ -w ~/Work/cognia/t_opengl.d -of/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/t_opengl 
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libgl3n.a(util.o): In function `no symbol': 
gl3n/util.d:(.text+0x6): undefined reference to `_Dmodule_ref' 
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libgl3n.a(linalg.o): In function `no symbol': 
gl3n/linalg.d:(.text+0x6): undefined reference to `_Dmodule_ref' 
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libgl3n.a(plane.o): In function `no symbol': 
gl3n/plane.d:(.text+0x6): undefined reference to `_Dmodule_ref' 
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libgl3n.a(plane.o): In function `_D4gl3n5plane13__T6PlaneTTfZ6PlaneT8opEqualsMxFNaNbNfS4gl3n5plane13__T6PlaneTTfZ6PlaneTZb': 
gl3n/plane.d:(.text._D4gl3n5plane13__T6PlaneTTfZ6PlaneT8opEqualsMxFNaNbNfS4gl3n5plane13__T6PlaneTTfZ6PlaneTZb+0x51): undefined reference to `_D4gl3n6linalg16__T6VectorTfVi3Z6Vector53__T8opEqualsTxS4gl3n6linalg16__T6VectorTfVi3Z6VectorZ8opEqualsMxFNaNbNfxS4gl3n6linalg16__T6VectorTfVi3Z6VectorZb' 
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libgl3n.a(math.o): In function `no symbol': 
gl3n/math.d:(.text+0x6): undefined reference to `_Dmodule_ref' 
collect2: error: ld returned 1 exit status 
--- errorlevel 1 

什麼是_Dmodule_ref鏈接到我最小的程序

import gl3n.linalg; 
pragma(lib, "gl3n"); 
void main(string args[]) { 
} 

gl3n作爲

dmd -debug -gc -unittest -D -Dd/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/ -w ~/Work/cognia/t_opengl.d -of/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/t_opengl 

它的錯誤?

回答

1

_Dmodule_ref是druntime中的特殊符號。這裏的問題很可能與當前工作目錄中錯誤安裝的druntime或object.d有關。

1)編譯hello世界工作嗎?如果沒有,可能有助於重新安裝dmd/druntime/phobos。

2)在名爲object.d的gl3n應用程序所在的目錄中是否有文件?如果是這樣,請重新命名它,或者因爲dmd可以在那裏看到它並且感到困惑,因爲它想讓它作爲一個自定義的druntime。