glutInit() 抛出错误 - 找不到 DLL
我目前正在用 C# 构建一个应用程序,使用我在 VB.net 中为涉及 openGL 的应用程序提出的基本设计。使用VB中的Tao框架,我有以下方法:
Private Sub checkForGlutInit()
If glut_initialized = False Then
Glut.glutInit()
glut_initialized = True
End If
End Sub
该方法在Form1.Load期间调用,因此允许程序在尝试绘制任何内容之前初始化所有GL变量。一切都运行得很完美。然后我将所有相同的代码翻译成 C Sharp 来开始一个新的应用程序。
private void checkForGlutInit()
{
if (glut_initialized == false)
{
Glut.glutInit();
glut_initialized = true;
}
}
当 C Sharp 中的这个方法被调用时,它会调用 Glut.glutInit(),但该方法随后会因错误而终止,告诉我无法找到 DLL。我已经复制了环境设置(编译 x86 代码,将 DLL 复制到 Debug 和 Release 目录),但仍然收到错误。
C Sharp 是否有与 VB 不同的方式管理 DLL?如果没有,我在引用 DLL“freeglut”时是否可能遗漏了什么?
I'm currently building an application in C#, using a basic design I came up with in VB.net for applications involving openGL. Using the Tao framework in VB, I have the following method:
Private Sub checkForGlutInit()
If glut_initialized = False Then
Glut.glutInit()
glut_initialized = True
End If
End Sub
This method is called during Form1.Load and thus allows the program to initialize all the GL variables before trying to draw anything. Everything runs perfectly. I then translated all of the same code over to C sharp to begin a new application.
private void checkForGlutInit()
{
if (glut_initialized == false)
{
Glut.glutInit();
glut_initialized = true;
}
}
When this method in C sharp gets called, it makes the call to Glut.glutInit(), but the method then terminates with an error, telling me that the DLL cannot be found. I've duplicated the environment settings (compiling x86 code, copying the DLLs to both the Debug and Release directories), but I'm still getting the error.
Is there something about C sharp that manages DLLs differently than VB? If not, is there something that I may be missing about referencing the DLL 'freeglut'?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 freeglut dll 复制到 Windows/SysWoW64 和 Windows/System32。
如果 freeglut dll 出现问题,它应该会有所帮助。
Try coping freeglut dlls to both Windows/SysWoW64 and Windows/System32.
It should help if its problem with freeglut dll.