View Full Version : trouble compiling glut

07-12-2008, 11:02 AM
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?


07-12-2008, 11:08 AM
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.

07-12-2008, 11:21 AM
You shoudln't use glut: it is outdated. Use freeglut instead (same API newer implementation).

07-12-2008, 12:14 PM
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.

07-13-2008, 12:33 AM
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.

07-13-2008, 04:07 AM
Add the glut library to your linker options.

07-13-2008, 09:22 PM
Thank you for your reply. But how do I do that?

07-13-2008, 11:36 PM
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.

07-14-2008, 12:06 AM
depends on the system. but you should not put the extension.

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

07-14-2008, 08:18 AM
Just add the GLUT.framework to your project. If you don't know how to add a framework to your project try these tutorials...


07-14-2008, 10:26 PM
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. :P

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.


Maybe I should just get the precompiled .lib files.

07-14-2008, 10:49 PM
Wow, freeglut compiled so easily... I'm sold.