链接gl3n错误

时间:2013-08-24 08:51:54

标签: opengl d

当我尝试链接我的最小程序时

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

反对OpenGL库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

它错误为

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

1 个答案:

答案 0 :(得分:1)

_Dmodule_ref是druntime中的特殊符号。这里的问题很可能与错误安装的druntime或当前工作目录中的object.d有关。

1)编译hello world是否有效?如果没有,可能有助于重新安装dmd / druntime / phobos。

2)你的gl3n应用程序名为object.d的目录中是否有文件?如果是这样,重命名它或其他东西,因为dmd可以在那里看到它并感到困惑,认为你希望它作为一个自定义的druntime。