我通过二进制文件安装了openssl,并且我在那个确切的位置有那个确切的文件。但是在编译时我遇到了这个错误。任何的想法?
g++ main.cpp -I /usr/local/openssl/include/openssl/
In file included from main.cpp:1:0:
main.h:4:25: fatal error: openssl/evp.h: No such file or directory
compilation terminated.
更新:
下面的命令完成了这项工作,但我仍然面临错误。
g++ main.cpp -I/usr/local/openssl/include -L/usr/local/openssl/lib main.cpp -lcrypto
/usr/local/openssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x1d): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x33): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x3d): undefined reference to `dlclose'
任何的想法?:(
解决方案 :
g++ main.cpp -I/usr/local/openssl/include -L/usr/local/openssl/lib main.cpp -lcrypto -ldl