So, for example, I want to link a boost::thread library, I have to type -lboost_thread in the command line. However, how do I know the name of other libraries, so I don't have to guess the name to put in the command line. For example, to link thread library, I put -lboost_thread as a random guess from another linking example of boost library I saw. Is there a way to generally know the name of the library to put in command line?
1 Answer
Read the manual that comes with the library.
3 Comments
Amumu
I mean library linking in general, not just boost. Is it the same name as installed in the system, such as when I type 'apropos curl', it gives me libcurl, which means i will link to the library using that name?
oh whatever
@Amumu - each library comes with manual/instructions. Read them. Usually, if you install it - you know where it is and what the file name is, but if not - just read the instructions carefully.
glglgl
@Amumu Normally yes - the linker searches for the given name by putting
lib at the start and .so at the end. But reading the docs is a better approach.