我已经从源代码构建了OpenSSL(一个故意的旧版本;用它构建./config && make && make test)并且更愿意使用我构建的内容而不用make install链接我的程序.
失败的命令是:
gcc -Wall -Wextra -Werror -static -Lopenssl/openssl-0.9.8k/ -lssl -lcrypto
-Iopenssl/openssl-0.9.8k/include -o myApp source1.o source2.o common.o`
Run Code Online (Sandbox Code Playgroud)
我收到一系列类似的错误:
common.c:(.text+0x1ea): undefined reference to `SSL_write'
Run Code Online (Sandbox Code Playgroud)
这让我觉得我的OpenSSL有点时髦.如果我-Lopenssl/openssl-0.9.8k/从命令中省略,则错误将更改为无法:
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
Run Code Online (Sandbox Code Playgroud)
我是否错误地编译了OpenSSL?或者我该如何最好地解决这个问题?