Libraries?

This is a discussion on Libraries? within the C++ Programming forums, part of the General Programming Boards category; Hi, Can anyone tell me what is a library in c++ and how to implement it? From my understanding it ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    29

    Question Libraries?

    Hi,

    Can anyone tell me what is a library in c++ and how to implement it?

    From my understanding it seems to be a collection of headers and function, but how do i call them?

    Thanks for the effort

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,643
    That depends. If the library is "open-source" then you just include and go. Otherwise, you must invoke your linker to "see" the libraries before calling from the functions within...

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Hmm...
    How would i know what the libraries functions are?
    I open the file to view in notepad but are just "machine words", is there any way to find out on the file what are the functions?

    Thanks

  4. #4
    Registered User matheo917's Avatar
    Join Date
    Sep 2001
    Posts
    279
    Yes, if you have some nice IDE or even a notepad, you can edit a header file, for example: <iostream.h> , and look at its contents, that is --> only the declaration NOT the implementation....

    However, considering the level you're at now, I'm affraid that it would make much sense to you anyway.

    HINT: most books on C++ have an outlined table of reference, (usually at the end of the book) that gives you a particular header file and the description of some (mostly used) functions and some samples along the way too, if you get lucky....

    I think you know how to include them in your file ex:

    Code:
     #include <iostream.h>
    
     int main()
     {
        cout << "blah blah";
    
        return 0;
     }
    So if you really want to look at the declaration of a particular header file (i.e iostream.h) you can use your search utility in Windows (I pressume) and look for some (.h) files.

    good luck

    matheo917

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    I understand that but I'm asking about libraries for example some files have the extension name.lib, these libraries are a collection of functions right? How do i go about knowing what the functions are provided in these files and include them into my program?

    Thanks.

  6. #6
    Registered User matheo917's Avatar
    Join Date
    Sep 2001
    Posts
    279
    .lib.......are very very large extensible files, that are precompiled, what that means that most of them are in object format so for you to look at the source code you would need a decompiler,

    once again, i think you playing with something that you don't want to be playing with......


    Good Luck

    matheo917

  7. #7
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Hmm.. ok a decomplier, i try to find some...
    Thanks

  8. #8
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Hey about the decomplier thingy...
    There isn't one! If a decomplier exist, there's no need to buy software since you can get the source code.

    I need to know what are the functions inside .lib file so i can use them. Any c++ methods to call/ list out the functions in the .lib???

    Thanks

  9. #9
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Hmm...ok this means that if you have a foo.lib there MUST be a foo.h somewhere out there to show you the functions ....???
    Ahha yeah I got it.....

    Thanks a MILLION !!!!
    mind your own mind...

    PsychoMantis,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GCC: Compiling with both static and shared libraries
    By eatwithaspork in forum C Programming
    Replies: 4
    Last Post: 06-23-2008, 01:48 PM
  2. Replies: 7
    Last Post: 05-13-2008, 03:47 AM
  3. MinGW thread-safe runtime libraries
    By Mario F. in forum C++ Programming
    Replies: 3
    Last Post: 08-21-2006, 08:15 AM
  4. Libraries and headers
    By darksaidin in forum C++ Programming
    Replies: 10
    Last Post: 07-23-2003, 06:24 AM
  5. QT and external libraries
    By Quacker in forum Linux Programming
    Replies: 1
    Last Post: 04-08-2003, 07:02 AM

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