cppkafka icon indicating copy to clipboard operation
cppkafka copied to clipboard

Cannot compile examples on OS X

Open benstadin opened this issue 5 years ago • 2 comments

I'm on OS X 10.14.3 and configured cppkafka like this:

cmake -DRDKAFKA_ROOT_DIR=/Users/bstadin/dev/LoTUS/cppkafka/build -DCPPKAFKA_DISABLE_EXAMPLES=OFF ..

The library builds fine, but a subsequent make examples fails with:

[ 72%] Linking CXX executable producer
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [examples/producer] Error 1
make[2]: *** [examples/CMakeFiles/producer.dir/all] Error 2
make[1]: *** [examples/CMakeFiles/examples.dir/rule] Error 2
make: *** [examples] Error 2

This issue is often related to xcode command line build tools not being installed. Though, this is not the case for me and they are already installed:

xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates 

One thought: openssl version prints: LibreSSL 2.6.5

It's been OpenSSL on previous versions of OS X.

benstadin avatar Mar 01 '19 16:03 benstadin

update your CMakeLists.txt if your openssl install path is /usr/local/opt/openssl, add this direct: link_directories(/usr/local/opt/openssl/lib) link_directories(/usr/lib) include_directories(/usr/local/opt/openssl/include)

anonymousch avatar Mar 04 '19 03:03 anonymousch

This is still a problem and preventing me from using this library. It will not compile on OSX

bigOconstant avatar Jun 25 '20 12:06 bigOconstant