Building mongocxx with openssl on OS X El Capitan

475 views
Skip to first unread message

Ofer Reichman

unread,
Oct 13, 2015, 3:50:06 AM10/13/15
to mongodb-user
I'm having problems building the new C++ drivers on OS X El Capitan.

At first the C driver was built successfully and I had a compilation error when building the C++ driver:
  use of undeclared identifier 'mongoc_client_pool_set_ssl_opts';

I installed openssl using homebrew (brew install openssl). I then tried to rebuild everything. This time the C driver build failed.
The new error I'm getting:
In file included from src/mongoc/mongoc-client.c:48:
./src/mongoc/mongoc-ssl-private.h:25:10: fatal error: 'openssl/bio.h' file not found
#include <openssl/bio.h>

What went wrong?

Ofer Reichman

unread,
Oct 13, 2015, 10:38:01 AM10/13/15
to mongodb-user

My openssl include directory location:

/usr/local/Cellar/openssl/1.0.2d_1/include

If I hardcode it into the Makefile everything builds just fine. I suppose the problem might be with FindOpenSSL.

A. Jesse Jiryu Davis

unread,
Oct 17, 2015, 9:02:01 PM10/17/15
to mongodb-user
Thanks for the report, I can reproduce this. I've opened https://jira.mongodb.org/browse/CDRIVER-941

A. Jesse Jiryu Davis

unread,
Oct 17, 2015, 10:42:39 PM10/17/15
to mongodb-user
I've updated https://jira.mongodb.org/browse/CDRIVER-941 with instructions for a workaround:

make CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib"

Can you tell me, are you build the C Driver with CMake, or like "./autogen.sh && make && sudo make install"? And also, do you have "pkg-config" on your system?

Ofer Reichman

unread,
Oct 18, 2015, 6:45:52 AM10/18/15
to mongodb-user
Hey, thanks for your help.

I'm building the C driver using autogen+make.
And yes, I have pkg-config, installed in /usr/local/bin.
Reply all
Reply to author
Forward
0 new messages