Trouble pulling in libm

John Wood jwood at
Fri Jan 14 15:07:40 UTC 2011

Interesting problem.  I added a #warning to math.h in my rtems toolchain to make sure I was indeed pulling it in.
I also added #warning right above the round definition.

Then I rebuilt.  I saw that some files.  For example res_debug.c in cpukit\libnetworking\libc get both warnings
However the file in my driver only gets the first.  It looks like in my driver I am not meeting one of the these criteria

#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L

This is why I am getting the implicit declaration anyway.

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

On 01/14/2011 03:27 PM, John Wood wrote:
> 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/"   -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
Hmm, you seem to be using a home-grown toolchain under DOS ... This 
opens up many potential issues ....
> 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'
OK, here is the next issue: This file needs to "#include <math.h>"


More information about the users mailing list