Trouble pulling in libm

John Wood jwood at scisol.com
Fri Jan 14 14:27:12 UTC 2011


That’s where it was when I started.  Unfortunately...

powerpc/GNU C Linker building target APP_2
powerpc-rtems4.9-g++ --pipe -B../../../rtems/Install/powerpc-rtems4.9/dam/lib/ -specs bsp_specs -qrtems  -fno-keep-inline-functions -mcpu=403 -Dppc405 -Ddam -Wl,-Map="./debug/APP_2.map"   -o "./debug/APP_2.elf" ./debug/obj/Init.o ./debug/obj/appqsst.o ./debug/obj/icmpping.o ./debug/obj/sdsn_tx.o   -ltelnetd -lftpd -lptpd -lnfs -lm    

../../../rtems/Install/powerpc-rtems4.9/dam/lib\librtemsbsp.a(main_qsst_wavecfg.o): In function `CalculateLFMCoefficients':
c:\Projects\digital_modules\dam\cfg\config1\rtems\build\powerpc-rtems4.9\c\dam\lib\libbsp\powerpc\dam/../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:293: undefined reference to `round'
collect2: ld returned 1 exit status
make: *** [debug/APP_2.elf] Error 1



I am still getting a warning with <math.h> though.

powerpc-rtems4.9-gcc --pipe -B../../../../../.././lib/ -B../../../../../.././dam/lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H   -I../../../../../.././dam/lib/include  -Wall -ansi -fasm -mcpu=403 -Dppc405 -Ddam -O2 -g -fno-keep-inline-functions  -MT main_qsst_wavecfg.o -MD -MP -MF .deps/main_qsst_wavecfg.Tpo -c -o main_qsst_wavecfg.o `test -f '../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c' || echo '../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/'`../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c
../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c: In function 'rtems_shell_main_qsst_wavecfg':
../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:83: warning: unused variable 'qsstCtrl'
../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c: In function 'CalculateLFMCoefficients':
../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:293: warning: implicit declaration of function 'round'
../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:278: warning: unused variable 'f0_t'
../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:277: warning: unused variable 'k_t_sq'
mv -f .deps/main_qsst_wavecfg.Tpo .deps/main_qsst_wavecfg.Po




-----Original Message-----
From: Ralf Corsepius [mailto:ralf.corsepius at rtems.org] 
Sent: Friday, January 14, 2011 9:16 AM
To: John Wood
Cc: Thomas Doerfler; rtems-users at rtems.org
Subject: Re: Trouble pulling in libm

On 01/14/2011 03:03 PM, John Wood wrote:
> Here is the full line and I think the order is probably the problem.
>
>
> powerpc/GNU C Linker building target APP_2
> powerpc-rtems4.9-g++ --pipe -B../../../rtems/Install/powerpc-rtems4.9/dam/lib/ -specs bsp_specs -qrtems -fno-keep-inline-functions -mcpu=403 -Dppc405 -Ddam -Wl,-Map="./debug/APP_2.map"   -o "./debug/APP_2.elf" ./debug/obj/Init.o ./debug/obj/appqsst.o ./debug/obj/icmpping.o ./debug/obj/sdsn_tx.o   -lm -ltelnetd -lftpd -lptpd -lnfs
> ../../../rtems/Install/powerpc-rtems4.9/dam/lib\librtemsbsp.a(main_qsst_wavecfg.o): In function `CalculateLFMCoefficients':
> c:\Projects\digital_modules\dam\cfg\config1\rtems\build\powerpc-rtems4.9\c\dam\lib\libbsp\powerpc\dam/../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:293: undefined reference to `round'
> collect2: ld returned 1 exit status

As I already wrote on PM and as Thomas also indirectly said:
  The order of the libraries matters.

Usually you will want to move -lm to the end of the list of "-l"'s.

Ralf




More information about the users mailing list