please help me understand libraries/includes

Posted by fiftyeight on Ask Ubuntu See other posts from Ask Ubuntu or by fiftyeight
Published on 2011-07-01T00:59:16Z Indexed on 2011/07/01 8:31 UTC
Read the original article Hit count: 306

Filed under:
|

I'm trying to understand how libraries work.

  1. for example I downloaded a tarball and extracted it. Now I do "./configure", it searches in pre-defined directories from what I understand for certain library files. What does it do then? it creates a makefile, and the makefile contains the paths to these libraries? than I do "make", it complies the source code and hard-codes the locations of the libraries? am I correct? I do not really understand if libraries are files with pre-defined paths or the OS somehow gives access to the libraries through system calls.

  2. another example, I complied something on my computer than moved it to a remote server, the executable needs mysql libraries to work, the server has mysql but for some reason when execute the file it tells me "can't find libmysqlclient.so.16". is there a solution for this? is there a way to know where is tries to locate this file or give it another path? I can't compile it on the server since it has no compiler and I don't have root access to install packages

  3. last question is if in the sequence "./configure","make","make install" the "make install" command is the only one that actually puts files outside the directory in which these files reside? if for example the software will be installed in /usr/local/ is the "make install" command the only one that will require "sudo" before it? let me see if I got it correctly: "./configure" creates the Makefile according to the location of various files on your system. "make" compiles the source code according to this makefile. and "make install" moves the files to their appropriate location.

I know this has been very long I thank anyone who had the patience to read my question :)

© Ask Ubuntu or respective owner

Related posts about compiling

Related posts about shared-library