Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2011-09-08T14:52:16Z by haubi
SystemAdmin
SystemAdmin
549 Posts
ACCEPTED ANSWER

Pinned topic missing floor() function in libm.a ?!

‏2011-09-08T14:14:48Z |
I'm trying to compile a simple 'hello world' C program, which links to the math library and I am getting the compile error below could not find the floor() function. This same program compiles fine when using gcc inside the same AIX box. How do I fix this problem?
xlc -bnoquiet -lm -o testapp testapp.c
1506-507 (W) No licenses available. Contact your program supplier to add additional users. Compilation will proceed shortly.
(ld): halt 4
(ld): setfflag 4
(ld): savename testapp_xlc
(ld): filelist 5 1
(ld): i /lib/crt0.o
(ld): lib /usr/lib/libm.a
(ld): i testapp.o
(ld): lib /usr/lib/libxlopt.a
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libc.ahttp://shr.o: 2875 symbols imported.
LIBRARY: Shared object libc.ahttp://meth.o: 2 symbols imported.
LIBRARY: Shared object libc.ahttp://posix_aio.o: 20 symbols imported.
LIBRARY: Shared object libc.ahttp://aio.o: 18 symbols imported.
LIBRARY: Shared object libc.ahttp://pse.o: 5 symbols imported.
LIBRARY: Shared object libc.ahttp://dl.o: 4 symbols imported.
LIBRARY: Shared object libc.ahttp://pty.o: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 5
(ld): resolve
RESOLVE: 36 of 5144 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 4 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
RLD: Address Section Rld-type Referencing Symbol

.__floor 24 ER PR testapp.c(testapp.o)
00000030 .text R_RBR 12 .main
ER: The return code is 8.
make: The error code from the last command is 8.
Stop.
Updated on 2011-09-08T14:52:16Z at 2011-09-08T14:52:16Z by haubi
  • haubi
    haubi
    37 Posts
    ACCEPTED ANSWER

    Re: missing floor() function in libm.a ?!

    ‏2011-09-08T14:52:16Z  in response to SystemAdmin
    > tsolox wrote:
    
    > xlc -bnoquiet -lm -o testapp testapp.c   > (ld): lib /usr/lib/libm.a > (ld): i testapp.o
    

    Does it make a difference when you put libm.a after testapp.o?
    
    $ xlc -bnoquiet -o testapp testapp.c -lm
    

    /haubi/