ubuntu qt platform to build openssl development environment
1. Download and unzip
(Here takes the latest version downloaded from the current official website as an example, the official website address: http://www.openssl.org/source)
tar -zxvf openssl-1.1.1d.tar.gz
mv openssl-1.1.1d openssl
2. Compile and install
cd openssl
./config --prefix=/usr/local/ssl shared zlib-dynamic enable-camellia
make depend
make
make test
sudo make install
3. Configuration
Set environment variables:
add the following content to the
PATH of /etc/profile PATH=/usr/local/ssl/bin:$PATH
export PATH
View path
which openssl
View version
openssl version
Installed
4. Add header file configuration to qt project
Add in the pro project configuration file:
INCLUDEPATH += /usr/local/ssl/include
5. Add openssl dynamic library configuration to the qt project
Add in the pro project configuration file:
LIBS += /usr/local/ssl/lib/libssl.so /usr/local/ssl/lib/libcrypto.so
6. Add the search path of the runtime library
Create a new ssl.conf file in the /etc/ld.so.conf.d/ directory, add the directory
/usr/local/ssl/lib where the library file is located to the file and
execute
sudo ldconfig
to update /etc/ld.so .cache file;