2013-08-24 40 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。