Hi, I have a scheme program I'm trying to compile with Gambit-C in MinGW/MSYS under Windows. If I do
gsc -exe "filename"
the c file is output and gcc compiles fine-until it gets an error in the linker stage:( after successfully compiling DansScheme1.o and DansScheme1_.o and attempting to link them) C:...lib/libgambc.a(os_base.o):os_base.c:(.text+0x737):undefined reference to 'gai_strerrorA'
If I just compile with gsc -c "filename" it puts out a .c file no problem. What should I be looking for? If you need more details let me know. This is version 4.7.0 using Windows Vista with the prebuilt binaries. Any help would be much appreciated.Thanks, Dan
Afficher les réponses par date
Judging by http://msdn.microsoft.com/en-us/library/windows/desktop/ms738514(v=vs.85).as... you need to ensure the ws2_32 library is linked in.
2013/9/26 Dan Wilckens dwilckens@gmx.com
Hi, I have a scheme program I'm trying to compile with Gambit-C in MinGW/MSYS under Windows. If I do
gsc -exe "filename"
the c file is output and gcc compiles fine-until it gets an error in the linker stage:( after successfully compiling DansScheme1.o and DansScheme1_.o and attempting to link them) C:...lib/libgambc.a(os_base.o):os_base.c:(.text+0x737):undefined reference to 'gai_strerrorA'
If I just compile with gsc -c "filename" it puts out a .c file no problem. What should I be looking for? If you need more details let me know. This is version 4.7.0 using Windows Vista with the prebuilt binaries. Any help would be much appreciated.Thanks, Dan _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On 26/09/13 10:58, Dan Wilckens wrote:
Hi, I have a scheme program I'm trying to compile with Gambit-C in MinGW/MSYS under Windows. If I do
gsc -exe "filename"
the c file is output and gcc compiles fine-until it gets an error in the linker stage:( after successfully compiling DansScheme1.o and DansScheme1_.o and attempting to link them) C:...lib/libgambc.a(os_base.o):os_base.c:(.text+0x737):undefined reference to 'gai_strerrorA'
If I just compile with gsc -c "filename" it puts out a .c file no problem. What should I be looking for? If you need more details let me know. This is version 4.7.0 using Windows Vista with the prebuilt binaries. Any help would be much appreciated.Thanks, Dan _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
I was getting this error. I would recommend building gambit from source, that worked for me. You will still need to manually link some libraries but the gai_strerrorA problem goes away.
Hallo,
On Thu, Sep 26, 2013 at 10:36 AM, Peter Dean p.dean@internode.on.net wrote:
I was getting this error. I would recommend building gambit from source, that worked for me. You will still need to manually link some libraries but the gai_strerrorA problem goes away.
This is probably overkill. Gambit uses a script for invoking the C compiler and linker, exactly for this reason. By editing the script one can tweak the command line of the linker and add libraries to link to, for instance. On Windows it should be called `gambc-cc.bat`.
Cheers,
Hi, A couple weeks ago I had a problem getting gsc to make an exe; gcc ran into this problem in the link stage of doing gsc -exe ... (I'm using MinGW & MSYS on windows vista):
C:...lib/libgambc.a(os_base.o):os_base.c:(.text+0x737):undefined reference to 'gai_strerrorA'
I quickly got a reply suggesting I make sure ws2_32 was linked in (thanks Mikael), which I did (I used gsc to generate the needed c files and then gcc to compile with -lws2_32), but I was still running into the problem so I wrote about the issue at the MinGW forum. They said that gai_strerrorA is inline static header-only code. So it doesn't need to get linked to any library. I'm wondering if the problem is in this particular build of libgambc, perhaps? ( I'm using the prebuilt 32-bit windows version 4.7.0)
When compiling with gcc, I made sure it was linked to libgambc and libgambcgsc. Any ideas? Should I compile Gambit myself?
Thanks, Dan