编译 64 位时启动 GLUT 应用程序时出错
我有一个 GLUT 应用程序的基本框架。当我为 Win32 编译它时,它工作正常,但如果我为 x64 编译它,我会收到此错误:
应用程序无法正确启动 (0xc000007b)。单击“确定”关闭应用程序。
我将 glut64.lib
作为链接器的输入,它来自位于 "C:\ProgramData\NVIDIA Corporation\ 的 nVidia CUDA sdk NVIDIA GPU 计算 SDK\C\common\lib"
我想将 OpenGL 与 CUDA 结合使用,尽管这个简单的应用程序没有引用 CUDA。我在 Windows 7 64 位上运行 Visual Studio 2008。
您能提供的任何见解将不胜感激。
主要.cpp:
#include <GL/glut.h>
void renderScene(void)
{
}
int main( int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowPosition(100, 100);
glutInitWindowSize(320,320);
glutCreateWindow("CUDA Sandbox");
glutDisplayFunc(renderScene);
glutMainLoop();
return 0;
}
I have the bare bones of a GLUT app. When I compile it for Win32 it works fine, but if I compile it for x64 I get this error:
The application was unable to start correctly (0xc000007b). Click OK to close the application.
I have glut64.lib
as an input for the Linker, which comes from the nVidia CUDA sdk at "C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\lib"
I want to use OpenGL in conjunction with CUDA, though this bare bones app has no references to CUDA. I am running Visual Studio 2008 on Windows 7 64 bit.
Any insight you can provide will be appreciated.
Main.cpp:
#include <GL/glut.h>
void renderScene(void)
{
}
int main( int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowPosition(100, 100);
glutInitWindowSize(320,320);
glutCreateWindow("CUDA Sandbox");
glutDisplayFunc(renderScene);
glutMainLoop();
return 0;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否链接到了正确的(64 位)版本的库,并且路径上是否有正确的(64 位)dll?
Are you linking with the correct (64-bit) version of the library, and is the correct (64-bit) dll available on the path?
您所要做的就是添加项目的可执行路径:c:\ProgramData\NVIDIA Corporation\NVIDIA GPUComputing SDK\C\bin\win64\Debug(或您所在的任何配置)
这是 glut32.dll 和 glew64 的位置.dll 位于。更好的是,将这些 DLL 复制到本地项目文件夹中。
这就是我刚刚解决同样错误的方法。
All you have to do is add executable path of your project: c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\bin\win64\Debug (or whatever config you're on)
This is where glut32.dll and glew64.dll are located. Better still, copy these DLLs to your local project folder.
This is how I just solved the same error.