Advertisement

gcc and openGL

Started by October 17, 2006 04:01 PM
4 comments, last by gbiaki 17 years, 11 months ago
Hi Folks, I have cygwin installed on my PC (WinXP) including gcc. gcc works find and I have built apps with it. Today I downloaded the openGL library package which includes some exmaple programs which I would like to try before I get going. However, when I run make from the examples folder it appears to fail to link: $ make >> log.txt Warning: resolving _glutReshapeFunc by linking to _glutReshapeFunc@4 Use --enable-stdcall-fixup to disable these warnings Use --disable-stdcall-fixup to disable these fixups Warning: resolving _glutCreateWindow by linking to _glutCreateWindow@4 Warning: resolving _glutInitWindowSize by linking to _glutInitWindowSize@8 Warning: resolving _glutInitWindowPosition by linking to _glutInitWindowPosition @8 Warning: resolving _glutInitDisplayMode by linking to _glutInitDisplayMode@4 Warning: resolving _glutSwapBuffers by linking to _glutSwapBuffers@0 Warning: resolving _glutPostRedisplay by linking to _glutPostRedisplay@0 Warning: resolving _glutSetWindow by linking to _glutSetWindow@4 Warning: resolving _glutGetWindow by linking to _glutGetWindow@0 Warning: resolving _glutDisplayFunc by linking to _glutDisplayFunc@4 example1.o:example1.cpp:(.text+0x1d9): undefined reference to `_glutWireTorus' example1.o:example1.cpp:(.text+0x213): undefined reference to `_glutSolidTorus' example1.o:example1.cpp:(.text+0x443): undefined reference to `_glutMainLoop' collect2: ld returned 1 exit status make[1]: *** [example1] Error 1 make: *** [all] Error 2 I assume that cygwin setup put everything in the right place, so I dont know what is wrong. Clues anyone? Cheers Ian
I suggest to wipe your cygwin off your hard disk and instead use MinGW. MinGW is native port of GCC to Windows OS.
Advertisement
It appears that your application cannot link the GLUT (an external OpenGL helper library). Did you download GLUT and make sure your paths are correct?
This may seem dumb but I just downloaded the package and made no path changes as I assumed cygwin setup would do whatever is necessary. Sorry to be a dumbass pain but how do I check/chnage paths in the cygwin bash shell?
Quote: Original post by gbiaki
This may seem dumb but I just downloaded the package and made no path changes as I assumed cygwin setup would do whatever is necessary. Sorry to be a dumbass pain but how do I check/chnage paths in the cygwin bash shell?


The shell you're using has nothing to do with where programs look for their resources.

From your description of your problem, it sounds like the linker is looking in the right place for the libraries (this is done via a set of built-in standard library search paths and the -L argument on the linker command line). Because some symbols are resolved and others not, it may be a library versioning problem. Are your OpenGL and GLUT libraries compatible versions?

Stephen M. Webb
Professional Free Software Developer

thanks folks. it appears that my cygwin installation was bugger. I reinstalled and it worked fine

This topic is closed to new replies.

Advertisement