Hi all!
I'm currently trying for the first time to compile a window executable file. I tried using cygwin, since I am a bit familiar with it. I installed all that could be required and compiled gambit without any problems. Then I try to compile and link my program which also uses opengl, glu and glut. Everything compiles just fine, but problems arise when I get to the linking stage... Here I get undefined references from both glu and gambit internals. The output I have is:
gcc -mno-cygwin -I/home/admin/gambit-c/current/include -L/home/admin/gambit-c/current/lib -L/lib/w32api -o space-invaders opengl.o opengl-header.o glu.o glu-header.o glut.o glut-header.o scm-lib.o rbtree.o ppm-reader.o event-simulation.o texture.o sprite.o font.o coroutine.o engine.o user-interface-images.o user-interface.o space-invaders_.o -lglut32 -lglu32 -lopengl32 -lgambc -lutil
glu.o:glu.c:(.text+0x2898): undefined reference to `_gluBuild1DMipmapLevels' glu.o:glu.c:(.text+0x2fe0): undefined reference to `_gluBuild2DMipmapLevels' glu.o:glu.c:(.text+0x3794): undefined reference to `_gluBuild3DMipmapLevels' glu.o:glu.c:(.text+0x3b33): undefined reference to `_gluBuild3DMipmaps' glu.o:glu.c:(.text+0x3d89): undefined reference to `_gluCheckExtension' glu.o:glu.c:(.text+0x6b54): undefined reference to `_gluNurbsCallbackData' glu.o:glu.c:(.text+0x6d74): undefined reference to `_gluNurbsCallbackDataEXT' glu.o:glu.c:(.text+0xb684): undefined reference to `_gluUnProject4@76' /home/admin/gambit-c/current/lib/libgambc.a(setup.o):setup.c:(.text+0x16d4): undefined reference to `_setjmp' /home/admin/gambit-c/current/lib/libgambc.a(setup.o):setup.c:(.text+0x1a4b): undefined reference to `_setjmp' /home/admin/gambit-c/current/lib/libgambc.a(setup.o):setup.c:(.text+0x240a): undefined reference to `_setjmp' /home/admin/gambit-c/current/lib/libgambc.a(os_base.o):os_base.c:(.text+0x260): undefined reference to `___getreent' /home/admin/gambit-c/current/lib/libgambc.a(os_base.o):os_base.c:(.text+0x305): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_base.o):os_base.c:(.text+0x32c): undefined reference to `_hstrerror' /home/admin/gambit-c/current/lib/libgambc.a(os_base.o):os_base.c:(.text+0x338): undefined reference to `__imp__h_errno' /home/admin/gambit-c/current/lib/libgambc.a(os_base.o):os_base.c:(.text+0x947): undefined reference to `_sigemptyset' /home/admin/gambit-c/current/lib/libgambc.a(os_base.o):os_base.c:(.text+0x95f): undefined reference to `_sigaction' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x45): undefined reference to `_getrusage' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x300): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x35d): undefined reference to `_gethostbyaddr' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x39f): undefined reference to `_inet_pton' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x3c0): undefined reference to `_gethostbyaddr' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x3d2): undefined reference to `_gethostbyname' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x63b): undefined reference to `_gethostname' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x706): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x731): undefined reference to `_getservbyport' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x749): undefined reference to `_getservbyname' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x989): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x9a4): undefined reference to `_getprotobynumber' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x9b4): undefined reference to `_getprotobyname' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0xbb4): undefined reference to `_lstat' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0xfd4): undefined reference to `_getpwuid' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0xff0): undefined reference to `_getpwnam' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x1208): undefined reference to `_getgrgid' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x1224): undefined reference to `_getgrnam' /home/admin/gambit-c/current/lib/libgambc.a(os.o):os.c:(.text+0x1338): undefined reference to `_getppid' /home/admin/gambit-c/current/lib/libgambc.a(os_dyn.o):os_dyn.c:(.text+0x47): undefined reference to `_dlopen' /home/admin/gambit-c/current/lib/libgambc.a(os_dyn.o):os_dyn.c:(.text+0x61): undefined reference to `_dlsym' /home/admin/gambit-c/current/lib/libgambc.a(os_dyn.o):os_dyn.c:(.text+0x76): undefined reference to `_dlerror' /home/admin/gambit-c/current/lib/libgambc.a(os_dyn.o):os_dyn.c:(.text+0xa7): undefined reference to `_dlclose' /home/admin/gambit-c/current/lib/libgambc.a(os_dyn.o):os_dyn.c:(.text+0xeb): undefined reference to `_dlclose' /home/admin/gambit-c/current/lib/libgambc.a(_kernel.o):_kernel.c:(.text+0xe24b): undefined reference to `_setjmp' /home/admin/gambit-c/current/lib/libgambc.a(os_time.o):os_time.c:(.text+0x8e): undefined reference to `_clock_gettime' /home/admin/gambit-c/current/lib/libgambc.a(os_time.o):os_time.c:(.text+0x1f0): undefined reference to `_getrusage' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x294): undefined reference to `_select' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x96e): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x978): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xa51): undefined reference to `_fcntl' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xa76): undefined reference to `_fcntl' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xb05): undefined reference to `_connect' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xb0e): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xb2c): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xbb7): undefined reference to `_shutdown' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xbed): undefined reference to `_shutdown' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xda4): undefined reference to `_recv' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xe29): undefined reference to `_send' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xea7): undefined reference to `_socket' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xee6): undefined reference to `_setsockopt' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xf19): undefined reference to `_setsockopt' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xf4c): undefined reference to `_setsockopt' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0xf9b): undefined reference to `_ioctl' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x123d): undefined reference to `_bind' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1255): undefined reference to `_listen' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1313): undefined reference to `_accept' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1b7c): undefined reference to `_pipe' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1c3f): undefined reference to `_tcgetattr' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1c7e): undefined reference to `_tcsetattr' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1d0e): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1d34): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1d94): undefined reference to `_setsid' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1dd4): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1de5): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1e09): undefined reference to `_sigemptyset' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1e1d): undefined reference to `_sigaddset' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1e39): undefined reference to `_sigprocmask' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1e60): undefined reference to `_sigprocmask' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x1ee7): undefined reference to `_fork' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x2027): undefined reference to `_fcntl' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x2073): undefined reference to `_sysconf' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x20b9): undefined reference to `_environ' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x20d0): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x21b0): undefined reference to `___errno' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x2850): undefined reference to `_waitpid' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x29d6): undefined reference to `_getsockname' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x29f7): undefined reference to `_getpeername' /home/admin/gambit-c/current/lib/libgambc.a(os_io.o):os_io.c:(.text+0x2bb9): undefined reference to `_getsockname' /home/admin/gambit-c/current/lib/libgambc.a(os_shell.o):os_shell.c:(.text+0x69): undefined reference to `_environ' /home/admin/gambit-c/current/lib/libgambc.a(os_shell.o):os_shell.c:(.text+0x167): undefined reference to `_environ' /home/admin/gambit-c/current/lib/libgambc.a(os_shell.o):os_shell.c:(.text+0x2a1): undefined reference to `_environ' /home/admin/gambit-c/current/lib/libgambc.a(os_shell.o):os_shell.c:(.text+0x33f): undefined reference to `_environ' /home/admin/gambit-c/current/lib/libgambc.a(os_shell.o):os_shell.c:(.text+0x4fe): undefined reference to `_environ' /home/admin/gambit-c/current/lib/libgambc.a(os_shell.o):os_shell.c:(.text+0x678): more undefined references to `_environ' follow /home/admin/gambit-c/current/lib/libgambc.a(os_files.o):os_files.c:(.text+0x30b): undefined reference to `_mkfifo' /home/admin/gambit-c/current/lib/libgambc.a(os_files.o):os_files.c:(.text+0x3a5): undefined reference to `_link' /home/admin/gambit-c/current/lib/libgambc.a(os_files.o):os_files.c:(.text+0x44b): undefined reference to `_symlink' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x2b2): undefined reference to `_tcgetattr' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x2d4): undefined reference to `_fcntl' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x6d2): undefined reference to `_cfsetispeed' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x6de): undefined reference to `_cfsetospeed' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x702): undefined reference to `_tcsetattr' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x720): undefined reference to `_fcntl' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x898): undefined reference to `_ioctl' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x980): undefined reference to `_ctermid' /home/admin/gambit-c/current/lib/libgambc.a(os_tty.o):os_tty.c:(.text+0x999): undefined reference to `___errno' collect2: ld returned 1 exit status make: *** [space-invaders] Error 1
I can confirm that the librairies libopengl32 libglu32 libglut32 are in /lib/w32api and that libgamc is in /home/admin/gambit-c/current/lib. Can anyone guess where my problem lies?
Many thanks for your help! ^_^
David
Afficher les réponses par date
On Sat, May 31, 2008 at 12:30:31PM -0400, David St-Hilaire wrote :
Hi all!
Hi!
gcc -mno-cygwin -I/home/admin/gambit-c/current/include -L/home/admin/gambit-c/current/lib -L/lib/w32api -o space-invaders opengl.o opengl-header.o glu.o glu-header.o glut.o glut-header.o scm-lib.o rbtree.o ppm-reader.o event-simulation.o texture.o sprite.o font.o coroutine.o engine.o user-interface-images.o user-interface.o space-invaders_.o -lglut32 -lglu32 -lopengl32 -lgambc -lutil
Recently, trying to compile a C program on a computer from the lab, we realized that the order of the parameters *did* matter.
You might want to try writing a proper command (which also will be compatible with most unices, unlike what Linux is, and perhaps cygwin), somethinng like this one:
gcc -mno-cygwin -I/home/admin/gambit-c/current/include -L/home/admin/gambit-c/current/lib -L/lib/w32api -lglut32 -lglu32 -lopengl32 -lgambc -lutil opengl.o opengl-header.o glu.o glu-header.o glut.o glut-header.o scm-lib.o rbtree.o ppm-reader.o event-simulation.o texture.o sprite.o font.o coroutine.o engine.o user-interface-images.o user-interface.o space-invaders_.o -o space-invaders
Cheers,
P!