[plt-scheme] tree.cxx example file doesn't compile

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Aug 4 11:23:50 EDT 2005

At Thu,  4 Aug 2005 09:55:20 -0400, Hicham Zakaria wrote:
> C:\PLT\collects\mzscheme\examples>c:\plt\mzc.exe --linker c:/mingw/bin/g++.exe
> --ld tree.dll tree.obj 
> MzScheme compiler (mzc) version 209, Copyright (c) 2004 PLT Scheme, Inc.
> "tree.obj":
> 
> link-extension:
> g++.exe: C:\DOCUME~1\Zakaria\LOCALS~1\Temp\tmp27.base: No such file or
> directory
> .............>>
> 
> I work on the XP platforme and use MinGW 3.1. compiler.
> Does anyone knows how to get this problem fixed ?

mzc usually uses ld to link instead of gcc. For Unix linking, the
command line that mzc builds for ld works just as well for g++, but
that's not the case for Windows.

Adding "++ldl -lstdc++" instead of "--linker ...g++.exe" to the mzc
command line may fix the problem. Or you may have to add more libraries,
such as "++ldl -stdc++ ++ldl -lc". Or even more.

For example, I managed to link a Cygwin-compiled tree.obj using the
command

 mzc --ld tree.dll ++ldl -lstdc++ ++ldl -lc 
  ++ldl -Lc:/cygwin/lib/gcc-lib/i686-pc-cygwin/3.2/ ++ldl -lgcc
  ++ldl -lcygwin ++ldl -lkernel32
  tree.obj


Matthew



Posted on the users mailing list.