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
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
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...
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
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:
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.Code:#include <iostream.h> int main() { cout << "blah blah"; return 0; }
good luck
matheo917
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.
.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
Hmm.. ok a decomplier, i try to find some...
Thanks
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
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,