AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  Linkage error. Undefined symbol __floor

    Posted Fri June 30, 2006 12:45 PM

    Originally posted by: DennisRussell


    I am using the floor function in math.h. I am linking with libm.a but I am getting the following:

    ld: 0711-317 ERROR: Undefined symbol: .__floor
    ld: 0711-317 ERROR: Undefined symbol: .__ceil

    I linked the code with the -bloadmap:PARM option and I see the ld using the
    libm.a being used:

    (ld): lib /usr/lib/libdl.a
    (ld): lib /usr/lib/libc.a
    (ld): lib /usr/lib/libpthreads.a
    (ld): lib /usr/lib/libodm.a
    (ld): lib /usr/lib/libm.a
    (ld): lib /usr/lib/libbsd_r.a
    (ld): lib /usr/lib/libld.a
    (ld): lib /usr/lib/libperfstat.a
    (ld): lib /usr/lib/libnsl.a

    When I do a nm /usr/lib/libm.a, I see the functions defined in the library.
    This code was compiled against AIX5.2L and there were no problems. There were no changes to the code. We are migrating from AIX5.2 to AIX5.3.

    Has anybody experienced an issue like this? What other libraries do I need? Does anybody know why I am getting this error?

    Thank-you,


  • 2.  Re: Linkage error. Undefined symbol __floor

    Posted Tue July 18, 2006 02:36 PM

    Originally posted by: SystemAdmin


    I think I have the answer, not all, but enough.
    Please open /usr/include/math.h, and search __floor. then you can find this:
    #if (__xlC__ >= 0x0600) /* VAC version 6 and above */
    #define floor(__x) __floor(__x)
    #define ceil(__x) __ceil(__x)
    #endif /* __xlC__ >= 0x0600 */
    Maybe you have a xlc whose version is lager than 0x0600( I have 600268439176, and have this problem when I build perl from source code).

    I don't know the difference of function __floor , _floor and floor, but I changed __floor to floor and __ceil to ceil , and recover it after I completed the compiling.

    Hope useful to you.