我正在尝试使用Dlang运行OpenGL示例.
void onError(int code, const(char)* text) nothrow
{
}
Run Code Online (Sandbox Code Playgroud)
用法:
glfwSetErrorCallback(&onError);
Run Code Online (Sandbox Code Playgroud)
绑定代码:
__gshared {
da_glfwSetErrorCallback glfwSetErrorCallback;
...
extern( C ) @ nogc nothrow {
alias da_glfwSetErrorCallback = GLFWerrorfun function( GLFWerrorfun );
...
alias GLFWerrorfun = void function( int, const( char )* );
Run Code Online (Sandbox Code Playgroud)
我得到以下编译器错误:
Error: function pointer glfwSetErrorCallback (extern (C) void function(int, const(char)*) nothrow) is not callable using argument types (void function(int code, const(char)* text) nothrow)
Run Code Online (Sandbox Code Playgroud)
编译:2.065.0