trouble compiling glut

i running glutmake.bat from the visual studio 2005 command line, but it looks like glut32.dll is having a problem when linking glut32.lib

here’s the output:

C:\Projects\glut-3.7>nmake nodebug=1 -f Makefile.win

Making in lib subdirectory…

Making in glut subdirectory…
link /INCREMENTAL:NO /NOLOGO -entry:_DllMainCRTStartup@12 -dll -out:glut32.dll -def:glut.def glut_8x13.obj glut_9x15.obj glut_bitmap.obj glut_bwidth.obj glut_cindex.obj glut_cmap.obj glut_cursor.obj glut_dials.obj glut_dstr.obj glut_event.obj glut_ext.obj glut_fullscrn.obj glut_gamemode.obj glut_get.obj glut_hel10.obj glut_hel12.obj glut_hel18.obj glut_init.obj glut_input.obj glut_joy.obj glut_key.obj glut_keyctrl.obj glut_keyup.obj glut_mesa.obj glut_modifier.obj glut_mroman.obj glut_overlay.obj glut_roman.obj glut_shapes.obj glut_space.obj glut_stroke.obj glut_swap.obj glut_swidth.obj glut_tablet.obj glut_teapot.obj glut_tr10.obj glut_tr24.obj glut_util.obj glut_vidresize.obj glut_warp.obj glut_win.obj glut_winmisc.obj win32_glx.obj win32_menu.obj win32_util.obj win32_winproc.obj win32_x11.obj opengl32.lib glu32.lib winmm.lib kernel32.lib ws2_32.lib mswsock.lib advapi32.lib bufferoverflowu.lib user32.lib gdi32.lib comdlg32.lib winspool.lib
LINK : fatal error LNK1104: cannot open file ‘glut32.lib’

has anyone else experienced this?

thanks

it looks like VS is searching the glut lib where this one is not. Are you sure that your project is well configured? Is glut32.lib really in the lib path? I think the name should be libglut32.lib, but I don’t know visual studio.

You shoudln’t use glut: it is outdated. Use freeglut instead (same API newer implementation).

I agree, but looking twice to your ugly error log, are you compiling glut? I see : output:glut32.dll. In this case, the dll is may be already in use and consequently not allowed to be written into.

Hi everyone, how are you?
I am having a hard time compiling glut programs on the Mac. I tried using gcc and xcode to compile some glut code and both times this is what I get:

Undefined symbols:
“_glutDisplayFunc”, referenced from:
_main in ccQfsuJ1.o
“_glutMainLoop”, referenced from:
_main in ccQfsuJ1.o
“_glutInitDisplayMode”, referenced from:
_main in ccQfsuJ1.o
“_glutInit”, referenced from:
_main in ccQfsuJ1.o
“_glutInitWindowPosition”, referenced from:
_main in ccQfsuJ1.o
“_glutCreateWindow”, referenced from:
_main in ccQfsuJ1.o
“_glutInitWindowSize”, referenced from:
_main in ccQfsuJ1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Does anyone know how to fix this problem? Thanks in advance.

Add the glut library to your linker options.

Thank you for your reply. But how do I do that?

I tried to compile with “gcc -lglut.o” and “gcc -lglut.lib” but neither worked. Does anyone know the name of the glut object file?

Thanks in advance.

depends on the system. but you should not put the extension.

Something like “gcc -lglut” (most probable) or “gcc -lglut32” or “gcc -lGLUT”

Just add the GLUT.framework to your project. If you don’t know how to add a framework to your project try these tutorials…

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Mac_OS_X
http://blog.onesadcookie.com/2007/12/xcodeglut-tutorial.html

I assumed that the glut source code I downloaded would just compile fine without any poking and proding, but I guess that’s too much to ask. :stuck_out_tongue:

Also I assumed that compiling the glut source code would produce the glut32.lib file… perhaps I need glut32.lib first, but that doesn’t really make any sense.

Anyone?

Maybe I should just get the precompiled .lib files.

Wow, freeglut compiled so easily… I’m sold.

Thanks.