-lm -ldl -lutil<br><br><div class="gmail_quote">On Mon, Mar 17, 2008 at 5:10 PM, David St-Hilaire <<a href="mailto:sthilaid@iro.umontreal.ca">sthilaid@iro.umontreal.ca</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello!<br>
<br>
I'm trying to compile a simple file which uses a bit of math and list functions.<br>
As far as I can remember, I never used other libraries than -lgambit when<br>
compiling the generated .c files, but now, it seems that I need to add also -lm<br>
to include the C math library... If I don't I get something like:<br>
<br>
gcc -I/opt/gambit-c/current/include -o question3 scm-lib.c Question3.c<br>
Question3_.c -lgambc -lutil -L/opt/gambit-c/current/lib<br>
/tmp/ccitDGGo.o: In function `___H_standard_2d_deviation':<br>
scm-lib.c:(.text+0xcfa4): undefined reference to `sqrt'<br>
/tmp/cc7ItBpa.o: In function `___H_standard_2d_deviation':<br>
Question3.c:(.text+0xd1c3): undefined reference to `sqrt'<br>
/opt/gambit-c/current/lib/libgambc.a(setup.o): In function `___setup':<br>
setup.c:(.text+0x199d): undefined reference to `fabs'<br>
setup.c:(.text+0x19bd): undefined reference to `floor'<br>
setup.c:(.text+0x19e7): undefined reference to `ceil'<br>
setup.c:(.text+0x1a11): undefined reference to `exp'<br>
...<br>
os_dyn.c:(.text+0x80): undefined reference to `dlclose'<br>
/opt/gambit-c/current/lib/libgambc.a(os_dyn.o): In function `___dynamic_load':<br>
os_dyn.c:(.text+0x296): undefined reference to `dlopen'<br>
os_dyn.c:(.text+0x2ad): undefined reference to `dlsym'<br>
os_dyn.c:(.text+0x2c6): undefined reference to `dlerror'<br>
os_dyn.c:(.text+0x2f8): undefined reference to `dlclose'<br>
...<br>
/opt/gambit-c/current/lib/libgambc.a(_num.o): In function `___H__20___num':<br>
_num.c:(.text+0x1d7bb): undefined reference to `exp'<br>
_num.c:(.text+0x1d820): undefined reference to `exp'<br>
_num.c:(.text+0x1d9c2): undefined reference to `exp'<br>
_num.c:(.text+0x1de92): undefined reference to `log'<br>
_num.c:(.text+0x1e0fb): undefined reference to `log'<br>
_num.c:(.text+0x1e2bd): undefined reference to `log'<br>
_num.c:(.text+0x1e4af): undefined reference to `sin'<br>
...<br>
collect2: ld returned 1 exit status<br>
make: *** [question3] Error 1<br>
<br>
<br>
As you can see, there is also some other missing library (using dlopen, etc...)<br>
which I don't know of... If I add -lm on my compilation line, then I remove all<br>
the math related errors, but I still get those related to dlopen, etc...<br>
<br>
What's going on? Is this normal? I'm pretty sure that I never had to compile<br>
with -lm before. I also compile with -lutil because Marc told me to, but I'm not<br>
sure I understand why either...<br>
<br>
Thanks! ^_^<br>
<font color="#888888"><br>
David<br>
<br>
</font><br>_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
<br></blockquote></div><br>