I am using Mandrake Linux with kernel 2.4.8. It had the wonderful version of gcc 2.96 installed on it stock. I've since downgraded to gcc 2.95.3. I've downloaded gpc-20010924, and installed it the regular old way I've installed all the other version of GPC I've gotten the past 2 years. It installs fine, into /usr just like gcc.
I can compile files with no problem as well. I compile all my pascal files to only create object files, no other parameters from the command line. When linking all these objects together statically, I get a few errors like this: /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgpc.a(rts.o): In function `_p_Real_Sin': /v/oldham/gcc-2.95.3/gcc/p/rts/rts.c:642: undefined reference to `sin'
I get the same thing for the functions cos, log, pow, sinl, cosl, logl, expl, powl, sinh, cosh. I've researched this some, and linking the -lm (math library) while performing my link does not help this. Can anyone help at all with this in particular?
Should GPC have linked -lm while it was building? And if so, can someone help me find where that is. I've been looking at this for hours now.
Thanks, Adam
----------------------------------------------------------------------- C. Adam Oldham Marconi Commerce Systems Inc. Software Engineer 7300 West Friendly Ave. adam.oldham@marconi.com Greensboro, NC 27420-2087 Phone : 336.547.5952 Fax : 336.547.5079 ----------------------------------------------------------------------- This document contains confidential information of Marconi Commerce Systems Inc. In consideration of the receipt of this document, the recipient agrees not to reproduce, copy, use or transmit this document and/or the information contained herein, in whole or in part, or to suffer such actions by others, for any purpose except with written permission, first obtained, of Marconi Commerce Systems Inc., and further agrees to surrender the same to Marconi Commerce Systems Inc. upon demand. -----------------------------------------------------------------------
Oldham, Adam wrote:
I am using Mandrake Linux with kernel 2.4.8. It had the wonderful version of gcc 2.96 installed on it stock. I've since downgraded to gcc 2.95.3. I've downloaded gpc-20010924, and installed it the regular old way I've installed all the other version of GPC I've gotten the past 2 years. It installs fine, into /usr just like gcc.
I can compile files with no problem as well. I compile all my pascal files to only create object files, no other parameters from the command line. When linking all these objects together statically, I get a few errors like this: /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgpc.a(rts.o): In function `_p_Real_Sin': /v/oldham/gcc-2.95.3/gcc/p/rts/rts.c:642: undefined reference to `sin'
I get the same thing for the functions cos, log, pow, sinl, cosl, logl, expl, powl, sinh, cosh. I've researched this some, and linking the -lm (math library) while performing my link does not help this. Can anyone help at all with this in particular?
How you do link? Do you call gpc, gcc, or ld directly? What command line? Does it work if you just compile and link with GPC (--automake)? Does the linker command line you see with `-v' help you? ...
I think I mentioned once or twice in the past few days that I'd prefer complete reports ... :-(
Should GPC have linked -lm while it was building?
No, it's not the gpc executable, but your program executable that needs -lm.
Marco van de Voort wrote:
Should GPC have linked -lm while it was building? And if so, can someone help me find where that is. I've been looking at this for hours now.
Sounds like not linked with libgcc, or wrong (out of sync) version.
No, libm is quite independent of libgcc.
Frank