Linux installs C++ third-party libraries (errors may be reported)

The commands for installing C++ third-party libraries in Linux can be divided into two cases:

 

1. If it is a third-party library installed using the package manager, you can use the following command:

 

- Debian/Ubuntu system: sudo apt-get install libxxx-dev

- CentOS/RHEL system: sudo yum install libxxx-devel

 

Among them, xxx is the name of the library to be installed.

 

2. If the third-party library is manually installed by downloading the source code package, you can follow the steps below:

 

- Decompress the source package: tar -xzvf xxx.tar.gz

- Enter the decompressed directory: cd xxx

- Execute configure script: ./configure

- Compile and install the library: make && sudo make install

 

Among them, xxx is the name of the downloaded source package. If an error occurs during the execution of the configure script, you need to install the corresponding compilation tools and dependent libraries first. For the installation method of dependent libraries, please refer to the commands in the first case.

Guess you like

Origin blog.csdn.net/weixin_59246157/article/details/130653354