我只是想用 GLFW3 D 绑定做一个小测试。我使用创建一个新包
dub init glfw3Test
然后我在 glfw3Test\source\app.d 中写了一个小测试
import derelict.glfw3.glfw3;
void main()
{
// Load the GLFW 3 library.
DerelictGLFW3.load();
if(DerelictGLFW3.isLoaded)
{
// Do something cool!
}
}
我修改了默认的 JSON:
{
"name": "glfw3Test",
"dependencies":
{
"derelict-glfw3": "~master"
},
"configurations": [
{
"name": "glfw3Test",
"targetType": "executable"
}
]
}
我用 构建dub build
,一切都很好,但是当我试图启动可执行文件时,出现以下错误:
derelict.util.exception.SharedLibLoadException@../../../.dub/packages/derelict-util-1.0.2/source/derelict/util/exception.d(35): Failed to load one or more shared libraries:
libglfw.3.dylib - dlopen(libglfw.3.dylib, 2): image not found
libglfw3.dylib - dlopen(libglfw3.dylib, 2): image not found
我也尝试在不使用 DUB 的情况下手动编译我的应用程序,但我总是遇到同样的问题。
它似乎在寻找 GLFW3 共享库,但我认为该库是由构建过程静态链接的。
我在 OS X 10.10 上安装了 Xcode 6(DMD 编译器 2.065)