您好,登錄后才能下訂單哦!
靜態庫編譯
????????????????./config?
????????????????make
????????????????make install
動態庫編譯
????????????????./config shared
????????????????make
????????????????make install
問題1)relocation R_AARCH64_ADR_PREL_PG_HI21 ? ? ? ? ? ? ?
之前編譯完成靜態庫,沒有清理干凈,出現問題
指令????./config shared && make
出錯
usr/bin/ld: libcrypto.a(gost_eng.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `stderr@@GLIBC_2.17' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: libcrypto.a(gost_eng.o)(.text+0x4f0): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `stderr@@GLIBC_2.17'
/usr/bin/ld: final link failed: bad value
./stdio.h:477:1: error: 'gets' undeclared here (not in a function)
sed -i '/gets is a security hole/d' \
??? gettext-{runtime/gnulib-lib,tools/{gnulib-lib,libgettextpo}}/stdio.in.h
解決
make clean
./config shared
問題2)undefined reference to
undefined reference to `GENERAL_NAME_free@libcrypto.so.10'
undefined reference to `SSL_get_verify_result@libssl.so.10'
undefined reference to `SSL_CTX_set_default_passwd_cb_userdata@libssl.so.10'
undefined reference to `sk_num@libcrypto.so.10'
undefined reference to `SSL_CTX_ctrl@libssl.so.10'
undefined reference to `CRYPTO_set_dynlock_lock_callback@libcrypto.so.10'
undefined reference to `SSL_accept@libssl.so.10'
undefined reference to `SSL_new@libssl.so.10'
undefined reference to `SSL_CTX_set_cipher_list@libssl.so.10'
按照如上的make install操作,就可以解決該問題,否則需要通過-lssl -lcrypto鏈接指定的openssl庫,同時需要指定openssl的頭文件目錄
例子
g++? UploadMessageService_server.skeleton.cpp uploadmessageservice.cpp? thriftcom_types.cpp thriftcom_constants.cpp? pushmessageservice.cpp -lthrift-0.9.0 -lpthread -I /home -I ./? -L. -L /home/dong/3thrdparty/openssl-1.0.2j?? -fpermissive? -o output -DHAVE_NETINET_IN_H
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。