Thread: How do I know which function requires a '-lsomething'?

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    7

    Question How do I know which function requires a '-lsomething'?

    Dear all,


    If I use the math functions like 'sqrt', I need to compile with '-lm'.
    However, for example, using the function 'socket', does not require '-lanything'.

    So, how do I know which function requires a '-lsomething', before I get compiler error message? Is there any guides on that?


    Thanks in advance!
    Michael

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > Is there any guides on that?
    Your local documentation is about all there is to go on I'm afraid.

    There is "common practice" for some things, but each implementation can package functions into libraries in many different ways.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  3. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  4. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM