Query:api problems!

Discussion in 'C Programming' started by Jack Dowson, May 14, 2007.

  1. Jack Dowson

    Jack Dowson Guest

    Hello Everybody:
    I'm new to c.I am wondering who can tell me how to use API in my c program.

    Any help will be greatly appreciated!
    Dowson.
    Jack Dowson, May 14, 2007
    #1
    1. Advertising

  2. In article <f2a55c$2gu$99.com>, Jack Dowson <> wrote:

    >I'm new to c.I am wondering who can tell me how to use API in my c program.


    API is usually an abbreviation for "Application Programmer Interface".
    For any packaged routines, the program's API is the official documented
    methods of getting the routines to do whatever they are supposed to.

    If you have a routine that has an API, then there is nothing
    special you need to do in your C program to use it. You just
    #include whatever header files the API documents that it requires,
    and you make the calls to the routines in the manner documented.


    The rest of this discussion involves practical development matters
    that the C standard leaves up to the implementation; your
    implementation might have a wildly different way of handling these
    matters (especially if you are using one of the "visual" compilers.)
    As far as the C standard goes, there are very few rules beyond
    that the implementation must give you -some- way to link different
    source files together. There is no right or wrong way in the standards
    for most of these points -- and that means that to find out the
    right way to do these things for your particular system, you need
    to ask in a newsgroup that deals with your operating system.


    You may need to tell the compiler where to find the include files
    for the package. The method of doing that depends on which compiler
    you are using. In -most- compilers that work from the command line,
    you would add an option that started with a dash followed by
    an upper-case I followed by the name of the directory to look in.
    For example, -I/opt/gnu/include would (usually) tell the
    compiler to look for include files in the directory /opt/gnu/include

    You will probably also need to tell your compiler to link
    the package into your executable. The method of doing that
    depends on which compiler you are using. In -most- compilers
    that work from the command line, you would add an option
    that started with dash followed by lower-case L followed
    by a representation of the name of the library, such as
    -lcrypto . The exact name you would use after the -l depends
    on your compiler: fairly common is that library names
    of the form libXXXX.something would become the option -lXXXX
    (i.e., remove the 'lib' prefix and any suffixes.) You may also
    have to tell the compiler where to find the library; fairly
    common in command-line compilers is to use an option that starts
    with a dash followed by an upper-case L followed by the directory
    to look in; e.g., -L/opt/gnu/lib32 -lcrypto to look for
    libcrypto.something in the directory /opt/gnu/lib32
    --
    Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
    Walter Roberson, May 14, 2007
    #2
    1. Advertising

  3. Jack Dowson

    Jack Dowson Guest

    Thank you so much,Roberson!
    Dowson.
    Jack Dowson, May 14, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shlomo Anglister
    Replies:
    1
    Views:
    400
    Default User
    Aug 2, 2004
  2. Praveen, Tayal (IE10)
    Replies:
    0
    Views:
    364
    Praveen, Tayal (IE10)
    Mar 17, 2005
  3. John123

    Profiling API or Membership API

    John123, Oct 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    John123
    Oct 20, 2006
  4. George2

    platform specific API or C standard API

    George2, Nov 12, 2007, in forum: C Programming
    Replies:
    13
    Views:
    735
    Tor Rustad
    Nov 13, 2007
  5. Timothy Grant
    Replies:
    5
    Views:
    408
    Timothy Grant
    Aug 6, 2008
Loading...

Share This Page