views:

382

answers:

3

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;
}
A: 

Are you linking with the correct (64-bit) version of the library, and is the correct (64-bit) dll available on the path?

Tom
The CUDA SDK examples use the file, and they work fine, but that is the only thing I am going off to say that it is the correct version. Is there a definitive way to tell?
Mr Bell
Short of checking the link input/directory in the project properties, and running a command prompt and doing `echo %PATH%`, I'm not sure!
Tom
Cool. Well I think I am going dispense with GLUT and try native my hand at windows opengl instead
Mr Bell
I wouldn't recommend doing raw OpenGL, since it's quite difficult to use. I would recommend SDL -- it's quite a solid library and still portable.
Travis Gockel
A: 

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.

Salman Ul Haq
A: 

Download freeglut, build it, and replace glut dll and lib with freeglut dll and lib.

Eric Lee