./configure make make install and GCC usage libraries some of the issues

Source: Internet
Author: User
First of all, what did/configure,make,install do separately?

/configure a shell script that examines the current compilation environment, such as the compiler, the number of machine bits, to generate makefile based on these parameters, to prepare for the next compilation, and to take some parameters to set the installation path or disable or enable some compilation options (important, May make times some of the missing dependencies are errors that can be avoided if these dependent libraries are disabled during the Configure phase.

Subsequent to the Make command call makefile, the compilation command is implemented in makefile, typically a process (for example, to compile a third-party dependency library), Compile multiple. c to become. O, and then put these. o Connect to a. A or. So file (note that the information printed on make is observed), the final goal of the compilation is already generated in the current directory, which is the directory where the installation process is located, at which point the library files can be used, for example, in our The source file contains the header file for the library, which has only the corresponding method declaration, the application that guides the source file to the corresponding dynamic and static libraries to find the specific implementation, but at this time did not execute make install, so the corresponding target file has not been installed to/usr or/usr/ Include, it is necessary to add some of the following parameters to specify the path to find the corresponding header file and static library. -i/home/hello/include indicates that the directory is selected as the first directory to look for header files, looking for the order of/home/hello/include>/usr/include>/usr/local/include-l/ The Home/hello/lib option is to make the corresponding directory to look for the first directory of the library file, looking for the order of/home/hello/lib>/usr/lib>/usr/local/lib-lworld Represents a dynamic library looking for libworld.so and libword.a on the path above specified Lib

Step three, make install
This is equivalent to copy the already compiled target files to the default installation directory, because it involves the system directory, so this step requires sudo to run as root, and then if you need to use the library file does not need to specify the path, but may still need to specify the corresponding library, such as-lpthread,- Lpcap

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.