我正在尝试构建一个D2 / Derelict3示例:
import std.stdio;
import derelict.opengl3.gl3;
import derelict.glfw3.glfw3;
void main(string[] args)
{
DerelictGL3.load();
DerelictGLFW3.load();
if (!glfwInit()) throw new Exception("Failed to initialize GLFW");
GLFWwindow* window = glfwCreateWindow(800, 600, "Hello DerelictGLFW3", null, null);
if (!window) throw new Exception("Window failed to create");
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
glfwTerminate();
}
但是我收到以下错误:
app.d(0,0): Error: module gl is in file 'derelict\opengl3\gl.d' which cannot be read (d2derelict)
我使用Derelict github页面上的指南构建了Derelict3,并使用dub初始化了一个文件夹。
如何配置dub以在我的项目中包含库?