Makefile errors from c code

This is a discussion on Makefile errors from c code within the C Programming forums, part of the General Programming Boards category; Hello everyone, I have this c app and I'm trying to run the make file for it....I keep getting the ...

  1. #1
    jl1
    jl1 is offline
    Registered User
    Join Date
    Jun 2010
    Posts
    2

    Makefile errors from c code

    Hello everyone, I have this c app and I'm trying to run the make file for it....I keep getting the following errors. I'm somewhat new to c and I don't understand what the errors below mean, it doesn't even provide a line number.

    Code:
    ld build/*.o  -shared -lm -lc -soname=libitl.so.0 -o build/libitl.so.0.0.7
    /usr/lib/libm.a(t-d000683.o):(.text+0x2): undefined reference to `_imp__acos'
    /usr/lib/libm.a(t-d001313.o):(.text+0x2): undefined reference to `_imp__pow'
    /usr/lib/libm.a(t-d000703.o):(.text+0x2): undefined reference to `_imp__asin'
    /usr/lib/libm.a(t-d000710.o):(.text+0x2): undefined reference to `_imp__atan'
    /usr/lib/libm.a(t-d001672.o):(.text+0x2): undefined reference to `_imp__tan'
    /usr/lib/libm.a(t-d000711.o):(.text+0x2): undefined reference to `_imp__atan2'
    /usr/lib/libm.a(t-d001584.o):(.text+0x2): undefined reference to `_imp__sin'
    /usr/lib/libm.a(t-d000761.o):(.text+0x2): undefined reference to `_imp__cos'
    /usr/lib/libm.a(t-d000913.o):(.text+0x2): undefined reference to `_imp__floor'
    /usr/lib/libm.a(t-d000922.o):(.text+0x2): undefined reference to `_imp__fmod'
    /usr/lib/libm.a(t-d001248.o):(.text+0x2): undefined reference to `_imp__modf'
    /usr/lib/libc.a(t-d001212.o):(.text+0x2): undefined reference to `_imp__malloc'
    /usr/lib/libc.a(t-d001318.o):(.text+0x2): undefined reference to `_imp__printf'
    make: *** [build/libitl.so] Error 1
    Am I missing an include statement in my code? I also keep getting the following warning:

    Code:
     warning: -fPIC ignored for target (all code is position independent)
    If anyone recognizes how to solve this problem I'd really appreciate if you can tell me.

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,047
    Seems that ld is pulling in the archive versions of shared libraries libm.a and libc.a instead of libm.so and libc.so; so make sure the shared versions exist.

  3. #3
    jl1
    jl1 is offline
    Registered User
    Join Date
    Jun 2010
    Posts
    2
    I'm using cygwin....do you know where I can find these files libc.so and libm.so?

    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile Errors in my Code. Can anyone help?
    By DGLaurynP in forum C Programming
    Replies: 1
    Last Post: 10-06-2008, 09:36 AM
  2. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Windows Programming
    Replies: 0
    Last Post: 10-14-2002, 01:29 PM
  3. RAM/Swap Memory Code Errors
    By ghe1 in forum Linux Programming
    Replies: 2
    Last Post: 04-01-2002, 06:37 AM
  4. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 11:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21