[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Embebed Mzscheme

Thx alot Richard... Somehow I think mzscheme and mzgc libs are
not enough... I get:
bash-2.05$ gcc -o scheme scheme.o -L/usr/local/plt/lib/mzscheme -L/usr/local/plt/lib/mzgc
scheme.o: In function `main':
scheme.o(.text+0x7): undefined reference to `scheme_basic_env'
scheme.o(.text+0x11): undefined reference to `scheme_current_thread'
scheme.o(.text+0x36): undefined reference to `scheme_current_thread'
scheme.o(.text+0x6e): undefined reference to `scheme_eval_string'
scheme.o(.text+0x86): undefined reference to `scheme_display'
scheme.o(.text+0x95): undefined reference to `scheme_char_constants'
scheme.o(.text+0xa0): undefined reference to `scheme_display'
collect2: ld returned 1 exit status

But there are no more libs to link to... 
I have scheme.h included in my .c... It's the only included one
like in the example... 

Best regards,


> Lo, on Tuesday, May 7, Paulo J. Matos did write:
> > Hi all,
> > 
> > Following the manual "Inside MzScheme" I've passed the example
> > in the first pages just to test if embebeding mzscheme is fine in
> > my PC... (I mean, if configs are ok) and I've found out that they
> > are not. After compiling DrScheme to get libmzscheme.a and
> > libmzgc.a as mentioned in the manual I've added
> > /usr/local/plt/lib to LD_LIBRARY_PATH and ran ldconfig as root.
> > Then I've tried to compile scheme.c (the file containing the
> > example) and I get:
> > bash-2.05$ gcc -o scheme scheme.o -lmzscheme -lmzgc
> > /usr/i386-slackware-linux/bin/ld: cannot find -lmzscheme
> > 
> > This is indeed strange.
> LD_LIBRARY_PATH is only relevant when you're running the built
> executable.  Try adding the -L switch to the compiler command line,
> specifying the directory where gcc should look for libraries: something
> like -L/usr/local/lib/plt/....  See the gcc man/info pages for more
> details.
> > However if I try to solve this by creating symbolic links to:
> > libmzscheme.a, libmzscheme.la, libmzgc.a, libmzgc.la I get a LOT
> The .la's are supplementary files created by libtool; you don't need
> those at all.  In any case, creating symlinks like this isn't the right
> answer; use the -L switch.
> Incidentally, do libmzscheme.so and libmzgc.so not exist?  (I don't have
> PLT installed right now due to computer problems, so I can't check
> myself.)  If they do, you'll almost certainly want to use those
> instead.  Of course, if you supply the correct directory with the -L
> switch, the compiler will default to the shared libs over the statics.
> > of undefined reference... I've pasted a few:
> > /usr/local/lib/libmzscheme.a(number.o): In function `exp_prim':
> > /home/pdestroy/src/plt/src/mzscheme/src/./number.c:1375: undefined reference to `exp'
> > /usr/local/lib/libmzscheme.a(number.o): In function `log_prim':
> > /home/pdestroy/src/plt/src/mzscheme/src/./number.c:1376: undefined reference to `log'
> > <snip>
> > /home/pdestroy/src/plt/src/mzscheme/src/./dynext.c:235: undefined reference to `dlopen'
> > /home/pdestroy/src/plt/src/mzscheme/src/./dynext.c:237: undefined reference to `dlerror'
> > /home/pdestroy/src/plt/src/mzscheme/src/./dynext.c:251: undefined reference to `dlsym'
> Check the man pages for the functions in question; they should tell you
> which additional libraries you need to link in.  exp and log are both in
> libm.so; dlopen, dlerror, and dlsym are all in libdl.so (at least on my
> Debian/stable system).  Add `-lm -ldl' to your command line.
> HTH,
> Richard

Paulo J. Matos : pocm(_at_)rnl.ist.utl.pt
Instituto Superior Tecnico - Lisbon    
Software & Computer Engineering - A.I.
 - > http://www.rnl.ist.utl.pt/~pocm 
	Yes, God had a deadline...
		So, He wrote it all in Lisp!