[gambit-list] Problems compiling program on Ubuntu

Marc Feeley feeley at iro.umontreal.ca
Thu Apr 28 12:12:44 EDT 2016


As a general rule it is best to let gsc do the linking of the executable program (using the -exe option) so that any necessary linker options are passed to the C compiler.  You can check which linking options are necessary by passing the -verbose option to gsc when compiling a small dummy program.

My guess is that the order of the -ldl and -lutil options is important.  Can you try putting them at the end of the options passed to gcc?

Marc

> On Apr 28, 2016, at 11:06 AM, Francois Magnan <fmagnan at me.com> wrote:
> 
> Hi,
> 
> I am trying to compile my program on the latest Ubuntu release 
> 
> 	gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) 
> 
> I have the lastest gambit that compiled flawlessly:
> 
> /usr/local/Gambit/bin/gsc -v
> v4.8.5 20160401231324 x86_64-unknown-linux-gnu “./configure '--enable-single-host' '--enable-gcc-opts'"
> 
> I build my program using:
> 
> /usr/local/Gambit/bin/gsc  -:f8,t8,-8 -link loader
> gcc -o athena loader.c loader_.c -lutil -ldl -lm  -L/usr/local/Gambit/lib/ /usr/local/Gambit/lib/libgambit.a -I/usr/local/Gambit/include/
> 
> 
> but at link I get the following error:
> 
> /usr/local/Gambit/lib/libgambit.a(os_dyn.o): In function `___dynamic_load':
> os_dyn.c:(.text+0x1c0): undefined reference to `dlopen'
> os_dyn.c:(.text+0x1d4): undefined reference to `dlsym'
> os_dyn.c:(.text+0x1ec): undefined reference to `dlerror'
> os_dyn.c:(.text+0x228): undefined reference to `dlclose'
> /usr/local/Gambit/lib/libgambit.a(os_dyn.o): In function `___cleanup_dyn_module':
> os_dyn.c:(.text+0x3dc): undefined reference to `dlclose'
> /usr/local/Gambit/lib/libgambit.a(os_io.o): In function `___device_stream_setup_from_process':
> os_io.c:(.text+0x21cc): undefined reference to `openpty'
> collect2: error: ld returned 1 exit status
> 
> 
> Any hint on what is wrong?
> 
> Thank you,
> Francois Magnan
> 
> 
> 
> 
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list




More information about the Gambit-list mailing list