Discussion:
[Cucumber] Building cucumber-cpp as a shared library
(too old to reply)
Leonard Norr
2018-03-07 10:15:21 UTC
Permalink
Raw Message
Hello,

I need to include cucumber-cpp as a shared library in a project, instead of
a static library and executable. Hoping someone already did this and may be
willing to share how. I'll list the steps I tried:

Step 1: Edit the "CMakeList.txt" in the cucumber-cpp src directory and
change to a shared lib:
# add_library(cucumber-cpp-nomain STATIC ${CUKE_SOURCES})
add_library(cucumber-cpp-nomain SHARED ${CUKE_SOURCES})
# add_library(cucumber-cpp STATIC ${CUKE_SOURCES} main.cpp)
add_library(cucumber-cpp SHARED ${CUKE_SOURCES} main.cpp)

This results in this error:
...
[ 36%] Linking CXX shared library libcucumber-cpp.dylib
Undefined symbols for architecture x86_64:
"boost::filesystem::detail::remove(boost::filesystem::path const&,
boost::system::error_code*)", referenced from:
boost::filesystem::remove(boost::filesystem::path const&) in
WireServer.cpp.o

Step 2: Ensure that Boost is not statically linked. I have edited the main
CMakeList.txt, but don't get the expected results. I'll keep trying and
post again once I figure this out.

P.S. I noticed that "cucumber-cpp-ng" is using shared libraries:
https://github.com/paoloambrosio/cucumber-cpp-ng/blob/master/CMakeLists.txt
I think this is a good direction as integrating cucumber-cpp is more
involved than Catch2. Using shared libraries simplifies integration, IMHO.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...