我下载了 OpenSSL 源码,做了 config
、make
、sudo make install
三部曲。
然后我构建了我的项目,在 libcrypto.a 和 libssl.a 中进行链接,但是得到了:
ld: warning: in /usr/local/ssl/lib/libcrypto.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in /usr/local/ssl/lib/libssl.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
我很确定我想将 OpenSSL 重新构建为 32 位 (i386),因为(由于与此问题无关的原因)我的项目需要是 32 位的。
如何在 Mac OS X 上将 OpenSSL 构建为 32 位? (我在“安装”文件中没有看到任何关于此的内容。)
最佳答案
$ curl https://www.openssl.org/source/openssl-1.0.0a.tar.gz | tar xz
$ cd openssl-1.0.0a
$ export CFLAGS="-arch i386"
$ export LDFLAGS="-arch i386"
$ ./config
$ make
$ lipo -info libssl.a
input file libssl.a is not a fat file
Non-fat file: libssl.a is architecture: i386
$ lipo -info libcrypto.a
input file libcrypto.a is not a fat file
Non-fat file: libcrypto.a is architecture: i386
关于macos - 如何在 Mac OS X 上将 OpenSSL 构建为 32 位 (i386)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4084210/