On 17-Apr-08, at 12:47 PM, Edward Tate wrote:
The problems came when I tried to do this with a file "_W32Window.ss" which binds to the C files "W32Window.h" and "W32Window.c", which requires support from external libraries.
The error I get is this (a few linker errors): C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x6db): undefined reference to `SwapBuffers@4' C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x746): undefined reference to `ChoosePixelFormat@8' C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x775): undefined reference to `SetPixelFormat@12' C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x794): undefined reference to `wglCreateContext@4' C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x7bd): undefined reference to `wglMakeCurrent@8' C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x7f4): undefined reference to `wglMakeCurrent@8' C:\DOCUME~1\malune\LOCALS~1\Temp/ccMXbaaa.o:_W32Window.c:(.text +0x80b): undefined reference to `wglDeleteContext@4' collect2: ld returned 1 exit status
I've tried modifying gsc-cc-o.bat so that the libs included were the same as the gcc that worked under the command line: "-mno-cygwin -lmingw32 -lgdi32 -lopengl32 -lglu32 -lgambc". But this did not change the outcome of the problem.
So basically I can link things statically without any problems because I'm calling gcc manually, but when I start to dynamically link things go wrong. Am I missing something obvious? Any thoughts would be highly appreciated.
Did you try specifying these options on the gsc command line? For example:
gsc -cc-options "-mno-cygwin" -ld-options "-lmingw32 -lgdi32 - lopengl32 -lglu32" _W32Window.ss
You don't need -lgambc, because that is already in gsi.
Marc