[plt-scheme] Problem compiling a tutorial program

From: Neil W. Van Dyke (neil at neilvandyke.org)
Date: Wed Nov 6 09:38:18 EST 2002

jblazi <jblazi at gmx.de> writes at 14:52 06-Nov-2002 +0100:
> D:\cygwin\home\Administrator\mzscheme>mzc --ld test1.dll test1.obj
> MzScheme compiler (mzc) version 202, Copyright (c) 1996-2002 PLT
> "test1.obj":
> link-extension:
> test1.obj(.eh_frame+0x11):test1.cpp: undefined reference to
> `__gxx_personality_v
> 0'
> Can anybody give me a hint?

A Google search for "__gxx_personality_v0" suggests that the linker
being called by "mzc" is not picking up the C++ library that the GCC
runtime uses.  On Unix, this library is named "libstdc++*", and is
linked automatically when the "g++" executable is used as a linker

This sounds like a minor tools configuration problem...

Try "mzc --ld --ldf-show test1.dll test1.obj" to see what linker command
line "mzc" is using.  If it is using "gcc", try adding "--linker g++" to
the command line.

(Cygwin might call the "g++" executable something different, like "gpp"
or "gxx".  Sorry I don't know Cygwin.)

Alternatively, instead of using "--linker g++", you can add the C++
library to the "mzc --ld" command line using the "++ldf" flag (see "mzc
--help").  Or you can invoke "g++" as a linker yourself, without using
"mzc" as a front-end, and just explicitly add the MzScheme library to
the command line.  But I'd try "--linker g++" first, and resort to the
others only if further debugging were needed.

                                                        Neil W. Van Dyke

Posted on the users mailing list.