Kdev - how linking to math lib ?

This is a discussion on Kdev - how linking to math lib ? within the C Programming forums, part of the General Programming Boards category; Kdev wants to know 1. optional lib's that should be linked: -lm 2.optional inlude-path: -l/usr/include at this point, i'd like ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    13

    Unhappy Kdev - how linking to math lib ?

    Kdev wants to know

    1. optional lib's that should be linked: -lm
    2.optional inlude-path: -l/usr/include

    at this point, i'd like to cry! I have changed the No. 2 several times, but with every compiling the ide says :"/home/joerg/c_test/src/c_test.c:16: undefined reference to `sqrt'

    Joerg

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    I don't know Kdev, sorry, but I do know this has been discussed before:

    http://cboard.cprogramming.com/c-programming/88943-undefined-reference-%27sqrt%27.html#post636547

    Have you tried compiling from the command line?

  3. #3
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    make sure that 'kdev' does in-fact ask for the libraries in that format. Rather it could want them just as "m", then it links as such: "gcc f.c -o f -l%s" where %s is the additional libraries to link against.

    As MacGyver cleverly suggested, ensure that your program compiles from the command line first :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. using VC6 link VC7 static lib error
    By George2 in forum C++ Programming
    Replies: 5
    Last Post: 06-29-2006, 10:58 PM
  2. how to use operator+() in this code?
    By barlas in forum C++ Programming
    Replies: 10
    Last Post: 07-09-2005, 07:22 PM
  3. Info regarding multiply linking single static lib
    By lightatdawn in forum Windows Programming
    Replies: 2
    Last Post: 04-01-2005, 03:18 AM
  4. (quick and easy) lib linking question
    By cjschw in forum C++ Programming
    Replies: 4
    Last Post: 09-01-2004, 06:04 PM
  5. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM

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