You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/11/21 10:19:41 UTC

[GitHub] [pulsar] wolfstudy opened a new issue #8660: [CPP Client] Can't build successfully when LINK_STATIC is ON

wolfstudy opened a new issue #8660:
URL: https://github.com/apache/pulsar/issues/8660


   **Describe the bug**
   
   I use the following command to execute cmake, and can't build successfully when LINK_STATIC is ON,
   
   ```
   cmake . -DBUILD_TESTS=OFF \
       -DLINK_STATIC=ON  \
       -DBOOST_ROOT=/usr/local/include \
       -DPYTHON_LIBRARY=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
       -DPYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
   ```
   
   the error info as follows:
   
   ```
   [ 93%] Built target SampleReaderCApi
   [ 93%] Built target SampleConsumerCApi
   [ 93%] Built target SampleConsumerListenerCApi
   [ 93%] Built target SampleProducerCApi
   [ 93%] Building CXX object perf/CMakeFiles/perfProducer.dir/PerfProducer.cc.o
   [ 93%] Building CXX object perf/CMakeFiles/perfConsumer.dir/PerfConsumer.cc.o
   [ 94%] Linking CXX static library libpulsar.a
   [ 94%] Linking CXX shared library libpulsarnossl.dylib
   Undefined symbols for architecture x86_64:
     "_EVP_MD_CTX_new", referenced from:
         pulsar::MessageCrypto::MessageCrypto(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, bool) in MessageCrypto.cc.o
     "_EVP_MD_CTX_reset", referenced from:
         pulsar::MessageCrypto::MessageCrypto(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, bool) in MessageCrypto.cc.o
     "_OPENSSL_init_ssl", referenced from:
         pulsar::MessageCrypto::MessageCrypto(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, bool) in MessageCrypto.cc.o
     "_OPENSSL_sk_num", referenced from:
         boost::asio::ssl::rfc2818_verification::operator()(bool, boost::asio::ssl::verify_context&) const in ClientConnection.cc.o
     "_OPENSSL_sk_value", referenced from:
         boost::asio::ssl::rfc2818_verification::operator()(bool, boost::asio::ssl::verify_context&) const in ClientConnection.cc.o
     "_SSL_CTX_get_default_passwd_cb_userdata", referenced from:
         boost::asio::ssl::context::~context() in ClientConnection.cc.o
     "_SSL_CTX_set_options", referenced from:
         boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in ClientConnection.cc.o
   ld: symbol(s) not found for architecture x86_64
   clang: error: linker command failed with exit code 1 (use -v to see invocation)
   make[2]: *** [lib/libpulsarnossl.2.7.0-SNAPSHOT.dylib] Error 1
   make[1]: *** [lib/CMakeFiles/pulsarSharedNossl.dir/all] Error 2
   make[1]: *** Waiting for unfinished jobs....
   [ 94%] Linking CXX executable SampleProducer
   [ 95%] Linking CXX executable SampleConsumer
   [ 95%] Built target SampleProducer
   /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpulsar.a(Log4cxxLogger.cc.o) has no symbols
   [ 95%] Built target SampleConsumer
   [ 95%] Linking CXX executable SampleConsumerListener
   [ 95%] Linking CXX executable SampleAsyncProducer
   [ 95%] Built target SampleConsumerListener
   [ 95%] Built target SampleAsyncProducer
   /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpulsar.a(Log4cxxLogger.cc.o) has no symbols
   ```
   
   When  replace`-DLINK_STATIC=ON` with `-DLINK_STATIC=OFF`, we can build successfully.
   
   **Desktop (please complete the following information):**
    - OS: MAC OS
    - Python: 2.7
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] wolfstudy commented on issue #8660: [CPP Client] Can't build successfully when LINK_STATIC is ON

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #8660:
URL: https://github.com/apache/pulsar/issues/8660#issuecomment-731559070


   We can use the following script to get the location of `PYTHON_LIBRARY` and `PYTHON_INCLUDE_DIR`:
   
   ```
   #!/bin/bash
   set -o errexit
   cd `dirname $0`
   PYTHON_LIB_DIR=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
   PYTHON_VERSION=$(python -c "import platform; print(platform.python_version()[:3])")
   PYTHON_LIBRARY="$PYTHON_LIB_DIR/libpython$PYTHON_VERSION.dylib"
   PYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
   echo "PYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR"
   echo "PYTHON_LIBRARY=$PYTHON_LIBRARY"
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org