Windows XP, Visual Studio .NET and GLUT (OpenGL)


Is there a way to recompile the GLUT Libraries to be used with Windows XP and Visual Studio .NET? Does anyone have the glut.lib, glut32.lib, glut.dll, glut32.dll and glut.h working with Visual Studio .NET and Windows XP?

It should work as it is without recompilation. I don’t use glut myself, but haven’t had any problems running glut apps on WinXP or compiling them with MSVC.NET

Running already compiled glut apps are fine. Writing and compiling new glut apps are not.

Originally posted by Humus:
It should work as it is without recompilation. I don’t use glut myself, but haven’t had any problems running glut apps on WinXP or compiling them with MSVC.NET

normally you can use the same libs and headers and dlls as always before, where is the problem you get?

First I get this message,

cube.cpp(134): fatal error C1010: unexpected end of file while

looking for precompiled header directive

So I set the Create/Use Precompile Header to Not Using Precompile Header under Page

Properties.

Then I get these message,

TestCubeProject error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in

function “void __cdecl polygon(int,int,int,int)” (?polygon@@YAXHHHH@Z)
TestCubeProject error LNK2019: unresolved external symbol __imp__glVertex3fv@4 referenced in

function “void __cdecl polygon(int,int,int,int)” (?polygon@@YAXHHHH@Z)
TestCubeProject error LNK2019: unresolved external symbol __imp__glNormal3fv@4 referenced in

function “void __cdecl polygon(int,int,int,int)” (?polygon@@YAXHHHH@Z)
TestCubeProject error LNK2019: unresolved external symbol __imp__glColor3fv@4 referenced in

function “void __cdecl polygon(int,int,int,int)” (?polygon@@YAXHHHH@Z)
TestCubeProject error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in

function “void __cdecl polygon(int,int,int,int)” (?polygon@@YAXHHHH@Z)
TestCubeProject error LNK2019: unresolved external symbol _glutSwapBuffers@0 referenced in

function “void __cdecl display(void)” (?display@@YAXXZ)
TestCubeProject error LNK2019: unresolved external symbol __imp__glFlush@0 referenced in

function “void __cdecl display(void)” (?display@@YAXXZ)
TestCubeProject error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in

function “void __cdecl display(void)” (?display@@YAXXZ)
TestCubeProject error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced

in function “void __cdecl display(void)” (?display@@YAXXZ)
TestCubeProject error LNK2019: unresolved external symbol __imp__glClear@4 referenced in

function “void __cdecl display(void)” (?display@@YAXXZ)
TestCubeProject error LNK2019: unresolved external symbol _glutPostRedisplay@0 referenced in

function “void __cdecl spinCube(void)” (?spinCube@@YAXXZ)
TestCubeProject error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in

function “void __cdecl myReshape(int,int)” (?myReshape@@YAXHH@Z)
TestCubeProject error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced

in function “void __cdecl myReshape(int,int)” (?myReshape@@YAXHH@Z)
TestCubeProject error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in

function “void __cdecl myReshape(int,int)” (?myReshape@@YAXHH@Z)
TestCubeProject error LNK2019: unresolved external symbol _glutMainLoop@0 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol _glutMouseFunc@4 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol _glutIdleFunc@4 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol _glutDisplayFunc@4 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol _glutReshapeFunc@4 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol _glutCreateWindow@4 referenced in

function _main
TestCubeProject error LNK2019: unresolved external symbol _glutInitWindowSize@8 referenced

in function _main
TestCubeProject error LNK2019: unresolved external symbol _glutInitDisplayMode@4 referenced

in function _main
TestCubeProject error LNK2019: unresolved external symbol _glutInit@8 referenced in function

_main
TestCubeProject fatal error LNK1120: 24 unresolved externals

So I add:

#pragma comment (lib, “opengl32.lib”)
#pragma comment (lib, “glu32.lib”)
#pragma comment (lib, “glut32.lib”)

in front of the #include statements.
it compiles successfully. But only brings up a blank windows.

All this using VS.NET to create a MFC.

Originally posted by davepermen:
normally you can use the same libs and headers and dlls as always before, where is the problem you get?

[This message has been edited by VS.NET-XP (edited 05-31-2002).]

hey! how bout linking with opengl32.lib and glut32.lib???

-Lev

Originally posted by Lev:
[b]hey! how bout linking with opengl32.lib and glut32.lib???

-Lev[/b]

That’s what the pragma statements at the bottom of the poster’s error description are for.

He indicates that it now compiles, but does not produce graphics output.

VS.NET-XP person: I am not familiar with .NET, but you mention creating an MFC application at the end of your post. Try creating a win32 console application instead.

I’m kinda confused about your having had to pragma the libs in your app - the glut header normally does that for you. Perhaps you’ve got an old glut distribution?

– Jeff

hmmmz I got the same problem here with the nvidia SDK

As I mentioned in the beginner’s form about this same topic, I was able to compile a glut app in .Net by using the VC6 headers and libraries with no problems. So far as him not getting any screen output, it is probably one of the many problems that plague beginners like not setting up the projection or modelview matrices correctly.

[This message has been edited by Deiussum (edited 05-31-2002).]

Just noticed the comment about MFC… I’m confused now. Are you using MFC to create your window or glutCreateWindow? If you’re using MFC to create the window, you’ll need to use ChoosePixelFormat, DescribePixelFormat, and SetPixelFormat in order to enable OpenGL. If you’re using glutCreateWindow, recreate your project as a Win32 console app and try again…

Tried the Win32 Project to create a win23 console version. Get these errors:

Win32ConsoleWin32ProjectCube fatal error LNK1169: one or more multiply defined symbols found
Win32ConsoleWin32ProjectCube error LNK2005: _main already defined in Win32ConsoleWin32ProjectCube.obj

and I am using glutCreateWindows. This is the whole program : http://www.eng.auburn.edu/~kchang/comp7400/cube.c from Dr. Angle’s web site http://www.cs.unm.edu/~angel/BOOK/SECOND_EDITION/

Link is the program that is a working program. Works fine compiling on Unix system with some #include monification. Professor did a demo. I add the #pragma comments line before the #include lines in order to get pass the link errors.

Originally posted by Deiussum:
[b]Just noticed the comment about MFC… I’m confused now. Are you using MFC to create your window or glutCreateWindow? If you’re using MFC to create the window, you’ll need to use ChoosePixelFormat, DescribePixelFormat, and SetPixelFormat in order to enable OpenGL. If you’re using glutCreateWindow, recreate your project as a Win32 console app and try again…

[/b]

Did you create a Win32 console app that had source code and then try and add that .c file as another file? That’s a no no… that will cause you to have two main() functions, and give you that error.

I know it doesn’t help you a lot, but I just did a GLUT program under VS.NET, works like a charm.

I don’t think the problem is from .NET nor GLUT. There must be something messy somewhere else.

Make sure you that in application settings you choose console application and
check empty project and turn of precompiled headers.
That should do it.