我正在尝试使用openssl中的函数EC_KEY_new_by_curve_name(NID_secp256k1)。但是,当我编译时,我得到以下错误:
undefined symbols for architecture x86_64:
"_EC_KEY_new_by_curve_name", referenced from:
CKey::CKey() in bitcoin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)我被暗示macos openssl不是用ECC扩展编译的。是不是有问题?如果是这样,我该如何纠正它呢?
发布于 2011-12-24 17:04:59
如果您使用的是MacOS软件开发工具包附带的OpenSSL库,那么它应该自动内置64位支持。
看看the first hit on Google,我想知道您的XCode项目中是否包含了正确的库。您是否将-lcrypto添加到项目设置中,或者忘记将libCrypto.dylib添加到项目中的库列表中?
在我的SnowLeopard (10.6)计算机上,我看到符号是在libCrypto中定义的
[/usr/lib]:; nm -arch x86_64 libcrypto.0.9.8.dylib | egrep -i new_by_curve
00000000000a4ac0 T _EC_GROUP_new_by_curve_name
00000000000ab540 T _EC_KEY_new_by_curve_namehttps://stackoverflow.com/questions/8623592
复制相似问题