背景
在区块链中采用国密加密算法,涉及到c代码编译成动态库供golang调用的问题。要满足linux下可运行,Darwin下可运行。linux下的相关编译已经在另一篇博文上记录过,已经可以运行。这里主要总结mac下的相关问题。
问题
符号表未定义问题
Undefined symbols for architecture x86_64:
"_BIO_ctrl", referenced from:
_LoadSM2PrivKeyFromFile in smcryptokit.o
_LoadSM2CertFromFile in smcryptokit.o
"_BIO_free", referenced from:
_LoadSM2PrivKeyFromFile in smcryptokit.o
_LoadSM2PrivKeyFromBytes in smcryptokit.o
_LoadSM2CertFromFile in smcryptokit.o
"_BIO_new", referenced from:
_LoadSM2PrivKeyFromFile in smcryptokit.o
_LoadSM2CertFromFile in smcryptokit.o
"_BIO_new_mem_buf", referenced from:
_LoadSM2PrivKeyFromBytes in smcryptokit.o
"_BIO_s_file", referenced from:
_LoadSM2PrivKeyFromFile in smcryptokit.o
_LoadSM2CertFromFile in smcryptokit.o
"_BIO_snprintf", referenced from: