Closed jtomschroeder closed 7 years ago
Looks like this broke in Sierra, a fully clean compile does not work on my Mac anymore either.
The error on my machine is:
Undefined symbols for architecture x86_64:
"_SSL_CTX_set1_param", referenced from:
_mongoc_stream_tls_openssl_new in libmongoc-priv.a(libmongoc_priv_la-mongoc-stream-tls-openssl.o)
"_X509_VERIFY_PARAM_set1_host", referenced from:
_mongoc_stream_tls_openssl_new in libmongoc-priv.a(libmongoc_priv_la-mongoc-stream-tls-openssl.o)
"_X509_VERIFY_PARAM_set1_ip_asc", referenced from:
_mongoc_stream_tls_openssl_new in libmongoc-priv.a(libmongoc_priv_la-mongoc-stream-tls-openssl.o)
"_X509_VERIFY_PARAM_set_hostflags", referenced from:
_mongoc_stream_tls_openssl_new in libmongoc-priv.a(libmongoc_priv_la-mongoc-stream-tls-openssl.o)
ld: symbol(s) not found for architecture x86_64
Upgrading the C driver in #21 did not fix it.
These instructions fixed it for me:
brew install openssl
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
I've added a note about this to the readme: 08ef8fbf2b94bb93d0f5e36e310a895d8539695c
Currently I don't see good options to make this smoother, so closing the issue.
@thijsc I've noticed that when pkg-config
is installed on macOS, CPPFLAGS
and LDFLAGS
do not have effect, as the configure script tries to use pkg-config
to detect OpenSSL and fails to do it because pkg-config
package for OpenSSL is not configured by Homebrew. Once I've uninstalled pkg-config
, the instructions with LDFLAGS
and CPPFLAGS
worked for me. It might be worth to mention this behavior in README.
Building the
mongo_driver
crate fails to link on macOS:Linking the
Security
andCoreFoundation
frameworks appears to resolve the linking issues.