- wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
- tar -vxf openssl-1.1.1a.tar.gz
- cd openssl-1.1.1a/
- ./config
- make
- sudo make install //到此安装openssl完毕
- cd curl-7.71.1/ //编译 curl 加上 ssl 库
- ./configure --prefix=$PWD/_install --with-ssl
- make
- make install
gcc *.c -I /home/pi/httpHandler/curl-7.71.1/_install/include -L /home/pi/httpHandler/curl-7.71.1/_install/lib -lwiringPi -lpthread -lcurl
编译的时候报错:
./curl-7.71.1/_install/lib//libcurl.so: undefined reference to `SSL_CTX_set_keylog_callback@OPENSSL_1_1_1'
./curl-7.71.1/_install/lib//libcurl.so: undefined reference to `SSL_CTX_set_post_handshake_auth@OPENSSL_1_1_1'
./curl-7.71.1/_install/lib//libcurl.so: undefined reference to `SSL_CTX_set_ciphersuites@OPENSSL_1_1_1'
在指令上加上 -lssl -lcrypto 就可以啦
/home/pi/httpHandler/curl-7.71.1/_install/include -L /home/pi/httpHandler/curl-7.71.1/_install/lib -lwiringPi -lpthread -lcurl -lssl -lcrypto