一.RedHat 手動(dòng)安裝openssl 如果缺少openssl相關(guān)的頭文件(如ssl.h等),,需要手動(dòng)安裝openssl,步驟如下: 1.到http://www./source/下載openssl源碼包 2.加壓源碼包后,,在解壓后對(duì)應(yīng)目錄依次執(zhí)行一下命令: a) ./config (默認(rèn)安裝在/usr/local/ssl目錄下,如果想修改安裝目錄執(zhí)行./config --prefix=目的目錄,。注:具體參考當(dāng)前目錄下的INSTALL文檔) b) make c) make test d) make instal 二.解決程序https處理中編譯出現(xiàn)的庫(kù)問(wèn)題 1.編譯添加 -lssl 2.如果提示以下錯(cuò)誤: undefined reference to `OPENSSL_add_all_algorithms_noconf' /usr/local/lib64/libssl.a(s23_clnt.o): In function `ssl23_connect': s23_clnt.c:(.text+0x15c): undefined reference to `RAND_add' s23_clnt.c:(.text+0x161): undefined reference to `ERR_clear_error' s23_clnt.c:(.text+0x1fa): undefined reference to `ERR_put_error' s23_clnt.c:(.text+0x42a): undefined reference to `RAND_pseudo_bytes' s23_clnt.c:(.text+0x57b): undefined reference to `RAND_pseudo_bytes' s23_clnt.c:(.text+0x6a6): undefined reference to `BIO_ctrl' s23_clnt.c:(.text+0x7ac): undefined reference to `sk_value' s23_clnt.c:(.text+0x7c2): undefined reference to `sk_num' s23_clnt.c:(.text+0x7e0): undefined reference to `RAND_pseudo_bytes' s23_clnt.c:(.text+0x802): undefined reference to `BUF_MEM_new' s23_clnt.c:(.text+0x81b): undefined reference to `BUF_MEM_grow'........ 編譯需要在-lssl后添加 -lcrypto 3. 如果提示以下錯(cuò)誤: /usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': dso_dlfcn.c:(.text+0x30): undefined reference to `dlopen' dso_dlfcn.c:(.text+0x43): undefined reference to `dlsym' dso_dlfcn.c:(.text+0x4e): undefined reference to `dlclose' /usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': dso_dlfcn.c:(.text+0x9d): undefined reference to `dladdr' dso_dlfcn.c:(.text+0xf2): undefined reference to `dlerror' /usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': dso_dlfcn.c:(.text+0x404): undefined reference to `dlsym' dso_dlfcn.c:(.text+0x4a2): undefined reference to `dlerror' /usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':............ 編譯需要添加-ldl |
|
來(lái)自: 落塵伊人 > 《網(wǎng)絡(luò)編程》