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 2021/06/25 17:20:47 UTC

[GitHub] [pulsar] brummetj commented on issue #11055: linker error for curl when using pulsar lib

brummetj commented on issue #11055:
URL: https://github.com/apache/pulsar/issues/11055#issuecomment-868716729


   Of course, i believe you will need to first compile pulsar from source ( i found same issue with brew libpulsar ) then create a new c/c++ project with a CMake that will need to first find the pulsar lib then try to compile your library ( without including curl into your Cmake) So this is all a little bit of a setup to re-produce but i can help as much as i can. The CMake i have is fairly tied to our project but maybe give you some sort of overview on how we set it up ...
   
   We have pulsar cloned into a `external` package. We compile pulsar like so ... 
   ```
   OUT_DIR="${BASE_DIR}/compiled"
   SRC_DIR="${BASE_DIR}/pulsar/pulsar-client-cpp"
   BUILD_DIR="${SRC_DIR}/pulsar-dist"
   rm -r ${BUILD_DIR} || true # could fail
   mkdir ${BUILD_DIR} || exit
   #echo "Made $BUILD_DIR"
   cd ${BUILD_DIR} && cmake -DBUILD_TESTS=OFF \
         -DBUILD_PYTHON_WRAPPER=OFF \
         -DCMAKE_INSTALL_PREFIX="${OUT_DIR}" \
         ${SRC_DIR}
   
   # build
   cd ${BUILD_DIR} && make -j 16
   
   cd ${BUILD_DIR} && make install
   ```
   
   We will have a `compile/include/pulsar` and a `compiled/lib` where `compiled/lib` contains all of the `libpulsar.a` related files. 
   
   Now we go into my project home, create our `_out` directory and run `cmake ../.`
   
   The CMake will find that pulsar lib, link libraries, and create our executable. 
   
   Once Cmake does its thing we run `make -j8`. After our sources compile, the linker commands will fail for our executable for pulsar like the errors I posted above. 
   
   The only solution i was able to figure out was linking curl into my target libraries. 
   
   I hope this can help in some way... 
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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