Discussion:
[Cucumber] [CPP] - build problem
(too old to reply)
Lukács István
2014-10-21 11:59:44 UTC
Permalink
Hi all,

I am trying to build cucumber-cpp on the basis of
"https://github.com/cucumber/cucumber-cpp".
The following Gmock and Gtest are installed on my Ubuntu:
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04

"cucumber-ruby-core" directory is in the Path.

the output of command "cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on
.." :
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR)
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
CMake Warning at CMakeLists.txt:128 (message):
Could not find Bundler: skipping Ruby Gem management


-- Found Cucumber
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/s-dev/cucumber-cpp/cucumber-cpp-master/build

Then I get the following error as output of "cmake --build build":
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o:
In function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
unsigned long>(char const*, char const*, int const&, unsigned long const&)':
ContextHandlingTest.cpp:(.text._ZN7testing8internal11CmpHelperEQIimEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIimEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x92):
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o:
In function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
int>(char const*, char const*, int const&, int const&)':
ContextHandlingTest.cpp:(.text._ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x8d):
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2

Does somebody have any idea to solve this problem?
I am waiting for your answer!

BR,
Istvan
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Lukács István
2014-10-21 12:07:46 UTC
Permalink
Hi all,

I am trying to build cucumber-cpp on Ubuntu. The version of OS is: 14.04.
My GMock and GTest versions are 1.6.0

The output of command "cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on
..":
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR)
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
CMake Warning at CMakeLists.txt:128 (message):
Could not find Bundler: skipping Ruby Gem management


-- Found Cucumber
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/sakura-dev/cucumber-cpp/cucumber-cpp-master/build

The error as the output of "cmake --build build":
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o:
In function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
unsigned long>(char const*, char const*, int const&, unsigned long const&)':
ContextHandlingTest.cpp:(.text._ZN7testing8internal11CmpHelperEQIimEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIimEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x92):
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o:
In function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
int>(char const*, char const*, int const&, int const&)':
ContextHandlingTest.cpp:(.text._ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x8d):
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2


Does somebody have any idea to solve this problem?
I am waiting for your answer!

BR,
Istvan
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Paolo Ambrosio
2014-10-25 17:04:19 UTC
Permalink
On Tue, Oct 21, 2014 at 12:59 PM, Lukács István
Post by Lukács István
Hi all,
I am trying to build cucumber-cpp on the basis of
"https://github.com/cucumber/cucumber-cpp".
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04
"cucumber-ruby-core" directory is in the Path.
the output of command "cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
I can't compile Boost 1.54.0 with GCC 4.8.2 (perhaps because of
https://svn.boost.org/trac/boost/ticket/9766).
Post by Lukács István
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR)
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
I suspect that the GTest library that CMake found is not the one in
GMock. It finds GTest in /usr/lib/libgtest.a but GMock from
/usr/src/gmock/libgmock.a.
Post by Lukács István
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
Could not find Bundler: skipping Ruby Gem management
-- Found Cucumber
-- Configuring done
-- Generating done
/home/s-dev/cucumber-cpp/cucumber-cpp-master/build
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2
Does somebody have any idea to solve this problem?
I am waiting for your answer!
Here you can find a script to download and compile Cucumber-CPP with
all dependencies:
https://gist.github.com/paoloambrosio/f4007067b51ffb14e0d4

It uses Boost 1.55, GMock 1.6, GTest 1.6.


Paolo
Post by Lukács István
BR,
Istvan
--
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.
Lukács István
2014-10-27 16:30:31 UTC
Permalink
Hi Paolo,

Thank you for your answer!

Now, I istalled Boost 1.55.
Rebuild my previously downloaded gmock (1.6) with its gtest and copied all
the *.a files to /usr/lib.
(I removed my previously used gtest from /usr/src/gtest.)
The problem was the same.

Then I updated the /usr/include/gtest directory. As a result of this, the
problem is solved, but I got a new error:

...
[ 60%] Building CXX object
tests/CMakeFiles/CukeCommandsTest.dir/unit/CukeCommandsTest.cpp.o
Linking CXX executable CukeCommandsTest
[ 60%] Built target CukeCommandsTest
Scanning dependencies of target GTestDriverTest
[ 61%] Building CXX object
tests/CMakeFiles/GTestDriverTest.dir/integration/drivers/GTestDriverTest.cpp.o
Linking CXX executable GTestDriverTest
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libgtest.a(gtest-all.cc.o):
undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing
from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/GTestDriverTest] Error 1
make[1]: *** [tests/CMakeFiles/GTestDriverTest.dir/all] Error 2
make: *** [all] Error 2

If you have any idea, do not hesitate to answer. :)

BR,
Istvan
On Tue, Oct 21, 2014 at 12:59 PM, Lukács István
Post by Lukács István
Hi all,
I am trying to build cucumber-cpp on the basis of
"https://github.com/cucumber/cucumber-cpp".
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04
"cucumber-ruby-core" directory is in the Path.
the output of command "cmake -E chdir build cmake
-DCUKE_ENABLE_EXAMPLES=on
Post by Lukács István
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
I can't compile Boost 1.54.0 with GCC 4.8.2 (perhaps because of
https://svn.boost.org/trac/boost/ticket/9766).
Post by Lukács István
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY
CPPSPEC_INCLUDE_DIR)
Post by Lukács István
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
I suspect that the GTest library that CMake found is not the one in
GMock. It finds GTest in /usr/lib/libgtest.a but GMock from
/usr/src/gmock/libgmock.a.
Post by Lukács István
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
Could not find Bundler: skipping Ruby Gem management
-- Found Cucumber
-- Configuring done
-- Generating done
/home/s-dev/cucumber-cpp/cucumber-cpp-master/build
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Post by Lukács István
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Post by Lukács István
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
Post by Lukács István
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
unsigned long>(char const*, char const*, int const&, unsigned long
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String
const&,
Post by Lukács István
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
Post by Lukács István
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String
const&,
Post by Lukács István
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2
Does somebody have any idea to solve this problem?
I am waiting for your answer!
Here you can find a script to download and compile Cucumber-CPP with
https://gist.github.com/paoloambrosio/f4007067b51ffb14e0d4
It uses Boost 1.55, GMock 1.6, GTest 1.6.
Paolo
Post by Lukács István
BR,
Istvan
--
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.
Alexis La Joie
2015-05-22 14:20:48 UTC
Permalink
Istvan,

I just got this working thanks to following the threads in your posts and
several others... however, it is was not a clear answer so I wanted to
respond here for you and any others who may be similarly stymied.

Once you get to the point that you are getting the error with compiling the
GTestDriverTest that you noted in your last post, you are actually not far
off. If the system is recognizing your GMock and GTest libraries, it just
needs an additional parameter for linking.

Basically it has to do with a change to how gmock and gtest now need
-lpthread added when they are used to compile other things. (See here:
http://askubuntu.com/questions/219516/howto-install-google-mock-on-ubuntu-12-10
)

It was not clear to me immediately how to do this directly within the
cucumber-cpp CMakeFiles system until I dug into the variables. In another
post I found that the CMake variable ${CMAKE_THREAD_LIBS_INIT} holds this
value. It apparently needs to be the last argument whenever GTest is used
in the linkings within the Cucumber-cpp cmake scripts.

To speed things up, this occurs in three files within Cucumber-cpp:


- cucumber-cpp/tests/CMakeLists.txt
- cucumber-cpp/examples/Calc/CMakeLists.txt
- cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt

In each of these, look where ${GTEST_LIBRARIES} are being added in the call
to target_link_libraries.

As such you just need to add ${CMAKE_THREAD_LIBS_INIT} as the last
argument in that call.

e.g.:
Original-> target_link_libraries(GTestCalculatorSteps Calc
${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
Becomes-> target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES} ${CUKE_LIBRARIES}
*${CMAKE_THREAD_LIBS_INIT}*)

I had the added pleasure of needing to do this in a Docker container that I
was trying to build to install into an instance of cyber-dojo. In order to
do this I added the following lines to my Docker file:

RUN git clone https://github.com/cucumber/cucumber-cpp.git

RUN sed -i 's/${GTEST_LIBRARIES})/${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})/g' cucumber-cpp/tests/CMakeLists.txt

RUN sed -i 's/${GTEST_LIBRARIES} ${CUKE_LIBRARIES})/${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})/g'
cucumber-cpp/examples/Calc/CMakeLists.txt

RUN sed -i 's/${GTEST_LIBRARIES} ${CUKE_LIBRARIES})/${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})/g'
cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt


This was obviously after I had already gotten all the required dependencies
installed (hint: I did it based from the g++4.9 GoogleMock image to make
sure that GMock was already properly installed... after that I just added
ruby, rspec, cucumber, etc...).


I hope this helps you and anyone else stuck like I was late last night.


Regards,

Alexis
Post by Lukács István
Hi Paolo,
Thank you for your answer!
Now, I istalled Boost 1.55.
Rebuild my previously downloaded gmock (1.6) with its gtest and copied all
the *.a files to /usr/lib.
(I removed my previously used gtest from /usr/src/gtest.)
The problem was the same.
Then I updated the /usr/include/gtest directory. As a result of this, the
...
[ 60%] Building CXX object
tests/CMakeFiles/CukeCommandsTest.dir/unit/CukeCommandsTest.cpp.o
Linking CXX executable CukeCommandsTest
[ 60%] Built target CukeCommandsTest
Scanning dependencies of target GTestDriverTest
[ 61%] Building CXX object
tests/CMakeFiles/GTestDriverTest.dir/integration/drivers/GTestDriverTest.cpp.o
Linking CXX executable GTestDriverTest
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing
from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/GTestDriverTest] Error 1
make[1]: *** [tests/CMakeFiles/GTestDriverTest.dir/all] Error 2
make: *** [all] Error 2
If you have any idea, do not hesitate to answer. :)
BR,
Istvan
On Tue, Oct 21, 2014 at 12:59 PM, Lukács István
Post by Lukács István
Hi all,
I am trying to build cucumber-cpp on the basis of
"https://github.com/cucumber/cucumber-cpp".
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04
"cucumber-ruby-core" directory is in the Path.
the output of command "cmake -E chdir build cmake
-DCUKE_ENABLE_EXAMPLES=on
Post by Lukács István
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
I can't compile Boost 1.54.0 with GCC 4.8.2 (perhaps because of
https://svn.boost.org/trac/boost/ticket/9766).
Post by Lukács István
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY
CPPSPEC_INCLUDE_DIR)
Post by Lukács István
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
I suspect that the GTest library that CMake found is not the one in
GMock. It finds GTest in /usr/lib/libgtest.a but GMock from
/usr/src/gmock/libgmock.a.
Post by Lukács István
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
Could not find Bundler: skipping Ruby Gem management
-- Found Cucumber
-- Configuring done
-- Generating done
/home/s-dev/cucumber-cpp/cucumber-cpp-master/build
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Post by Lukács István
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Post by Lukács István
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
Post by Lukács István
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
unsigned long>(char const*, char const*, int const&, unsigned long
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String
const&,
Post by Lukács István
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
Post by Lukács István
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String
const&,
Post by Lukács István
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2
Does somebody have any idea to solve this problem?
I am waiting for your answer!
Here you can find a script to download and compile Cucumber-CPP with
https://gist.github.com/paoloambrosio/f4007067b51ffb14e0d4
It uses Boost 1.55, GMock 1.6, GTest 1.6.
Paolo
Post by Lukács István
BR,
Istvan
--
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.
Paolo Ambrosio
2015-05-23 05:38:19 UTC
Permalink
On Fri, May 22, 2015 at 3:20 PM, Alexis La Joie
Post by Alexis La Joie
Istvan,
I just got this working thanks to following the threads in your posts and
several others... however, it is was not a clear answer so I wanted to
respond here for you and any others who may be similarly stymied.
Once you get to the point that you are getting the error with compiling the
GTestDriverTest that you noted in your last post, you are actually not far
off. If the system is recognizing your GMock and GTest libraries, it just
needs an additional parameter for linking.
Basically it has to do with a change to how gmock and gtest now need
http://askubuntu.com/questions/219516/howto-install-google-mock-on-ubuntu-12-10)
It was not clear to me immediately how to do this directly within the
cucumber-cpp CMakeFiles system until I dug into the variables. In another
post I found that the CMake variable ${CMAKE_THREAD_LIBS_INIT} holds this
value. It apparently needs to be the last argument whenever GTest is used in
the linkings within the Cucumber-cpp cmake scripts.
cucumber-cpp/tests/CMakeLists.txt
cucumber-cpp/examples/Calc/CMakeLists.txt
cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt
In each of these, look where ${GTEST_LIBRARIES} are being added in the call
to target_link_libraries.
As such you just need to add ${CMAKE_THREAD_LIBS_INIT} as the last argument
in that call.
Original-> target_link_libraries(GTestCalculatorSteps Calc
${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
Becomes-> target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
In the main CMakeLists.txt that is added to the CUKE_TEST_LIBRARIES:

if(UNIX)
find_package(Threads) # GTest needs this and it's a static library
set(CUKE_TEST_LIBRARIES ${CUKE_TEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif()

The error is that it's not used everywhere! Thanks for spotting it.
Post by Alexis La Joie
I had the added pleasure of needing to do this in a Docker container that I
was trying to build to install into an instance of cyber-dojo. In order to
RUN git clone https://github.com/cucumber/cucumber-cpp.git
RUN sed -i 's/${GTEST_LIBRARIES})/${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})/g' cucumber-cpp/tests/CMakeLists.txt
RUN sed -i 's/${GTEST_LIBRARIES} ${CUKE_LIBRARIES})/${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})/g'
cucumber-cpp/examples/Calc/CMakeLists.txt
RUN sed -i 's/${GTEST_LIBRARIES} ${CUKE_LIBRARIES})/${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})/g'
cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt
This was obviously after I had already gotten all the required dependencies
installed (hint: I did it based from the g++4.9 GoogleMock image to make
sure that GMock was already properly installed... after that I just added
ruby, rspec, cucumber, etc...).
Travis CI builds every merge in Cucumber-CPP so it doesn't just "work
on my computer" ;-)

Can you share a dockerfile that shows the problem? It should be an easy fix.

Cheers,
Paolo
Post by Alexis La Joie
I hope this helps you and anyone else stuck like I was late last night.
Regards,
Alexis
Post by Lukács István
Hi Paolo,
Thank you for your answer!
Now, I istalled Boost 1.55.
Rebuild my previously downloaded gmock (1.6) with its gtest and copied all
the *.a files to /usr/lib.
(I removed my previously used gtest from /usr/src/gtest.)
The problem was the same.
Then I updated the /usr/include/gtest directory. As a result of this, the
...
[ 60%] Building CXX object
tests/CMakeFiles/CukeCommandsTest.dir/unit/CukeCommandsTest.cpp.o
Linking CXX executable CukeCommandsTest
[ 60%] Built target CukeCommandsTest
Scanning dependencies of target GTestDriverTest
[ 61%] Building CXX object
tests/CMakeFiles/GTestDriverTest.dir/integration/drivers/GTestDriverTest.cpp.o
Linking CXX executable GTestDriverTest
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing
from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/GTestDriverTest] Error 1
make[1]: *** [tests/CMakeFiles/GTestDriverTest.dir/all] Error 2
make: *** [all] Error 2
If you have any idea, do not hesitate to answer. :)
BR,
Istvan
Post by Paolo Ambrosio
On Tue, Oct 21, 2014 at 12:59 PM, Lukács István
Post by Lukács István
Hi all,
I am trying to build cucumber-cpp on the basis of
"https://github.com/cucumber/cucumber-cpp".
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04
"cucumber-ruby-core" directory is in the Path.
the output of command "cmake -E chdir build cmake
-DCUKE_ENABLE_EXAMPLES=on
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
I can't compile Boost 1.54.0 with GCC 4.8.2 (perhaps because of
https://svn.boost.org/trac/boost/ticket/9766).
Post by Lukács István
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY
CPPSPEC_INCLUDE_DIR)
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
I suspect that the GTest library that CMake found is not the one in
GMock. It finds GTest in /usr/lib/libgtest.a but GMock from
/usr/src/gmock/libgmock.a.
Post by Lukács István
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
Could not find Bundler: skipping Ruby Gem management
-- Found Cucumber
-- Configuring done
-- Generating done
/home/s-dev/cucumber-cpp/cucumber-cpp-master/build
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
function `testing::AssertionResult testing::internal::CmpHelperEQ<int,
undefined reference to `testing::internal::EqFailure(char const*, char
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2
Does somebody have any idea to solve this problem?
I am waiting for your answer!
Here you can find a script to download and compile Cucumber-CPP with
https://gist.github.com/paoloambrosio/f4007067b51ffb14e0d4
It uses Boost 1.55, GMock 1.6, GTest 1.6.
Paolo
Post by Lukács István
BR,
Istvan
--
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
For more options, visit https://groups.google.com/d/optout.
--
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.
Alexis La Joie
2015-05-23 15:40:08 UTC
Permalink
Paulo,

Thank you for tracking this. I unfortunately do not have the erring
Dockerfile anymore, but the snippet in my previous post indicates which
CMakeLists.txt files would need to be changed to use
${CUKE_TEST_LIBRARIES} instead of the ${GTEST_LIBRARIES}


- cucumber-cpp/tests/CMakeLists.txt
- cucumber-cpp/examples/Calc/CMakeLists.txt
- cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt

although in the first file only ${GTEST_LIBRARIES} is referenced while in
the other two both ${GTEST_LIBRARIES} *AND* ${CUKE_LIBRARIES}.

As such the first file could simply replace ${TEST_LIBRARIES} with
${CUKE_TEST_LIBRARIES}.
eg: change cucumber-cpp/tests/CMakeLists.txt line 39
from:
cuke_add_driver_test(integration/drivers/GTestDriverTest
${GTEST_LIBRARIES})
to:
cuke_add_driver_test(integration/drivers/GTestDriverTest
${CUKE_TEST_LIBRARIES})

The other two are more complicated as one of the posts which I read seemed
to indicate that there was an order dependency for the -lpthread
argument... it needs to be the last argument. I do not know if there is an
order dependency in your script that requires ${GTEST_LIBRARIES} to proceed
${CUKE_LIBRARIES}.

If there is an order dependency then just appending ${CMAKE_THREAD_LIBS_INIT}
would suffice... I chose this as the simplest option.
eg: change cucumber-cpp/examples/Calc/CMakeLists.txt line 10
from:
target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES}
${CUKE_LIBRARIES})
to:
target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
change cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt line 10
from:
target_link_libraries(FeatureShowcaseSteps ${GTEST_LIBRARIES}
${CUKE_LIBRARIES})
to:
target_link_libraries(FeatureShowcaseSteps ${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

Of course, if there is NOT an order dependency, you could remove
${GTEST_LIBRARIES} and then append ${CUKE_TEST_LIBRARIES} after
${CUKE_LIBRARIES}.
eg:
change cucumber-cpp/examples/Calc/CMakeLists.txt line 10
from:
target_link_libraries(GTestCalculatorSteps Calc ${GTEST_LIBRARIES}
${CUKE_LIBRARIES})
to:
target_link_libraries(GTestCalculatorSteps Calc ${CUKE_LIBRARIES}
${CUKE_TEST_LIBRARIES})
change cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt line 10
from:
target_link_libraries(FeatureShowcaseSteps ${GTEST_LIBRARIES}
${CUKE_LIBRARIES})
to:
target_link_libraries(FeatureShowcaseSteps ${CUKE_LIBRARIES}
${CUKE_TEST_LIBRARIES})


would that work??

If you would like the working Dockerfile to play with I shall see about
pasting that in a follow up.

Kind Regards,
Alexis
Post by Paolo Ambrosio
On Fri, May 22, 2015 at 3:20 PM, Alexis La Joie
Post by Alexis La Joie
Istvan,
I just got this working thanks to following the threads in your posts
and
Post by Alexis La Joie
several others... however, it is was not a clear answer so I wanted to
respond here for you and any others who may be similarly stymied.
Once you get to the point that you are getting the error with compiling
the
Post by Alexis La Joie
GTestDriverTest that you noted in your last post, you are actually not
far
Post by Alexis La Joie
off. If the system is recognizing your GMock and GTest libraries, it
just
Post by Alexis La Joie
needs an additional parameter for linking.
Basically it has to do with a change to how gmock and gtest now need
http://askubuntu.com/questions/219516/howto-install-google-mock-on-ubuntu-12-10)
Post by Alexis La Joie
It was not clear to me immediately how to do this directly within the
cucumber-cpp CMakeFiles system until I dug into the variables. In
another
Post by Alexis La Joie
post I found that the CMake variable ${CMAKE_THREAD_LIBS_INIT} holds
this
Post by Alexis La Joie
value. It apparently needs to be the last argument whenever GTest is
used in
Post by Alexis La Joie
the linkings within the Cucumber-cpp cmake scripts.
cucumber-cpp/tests/CMakeLists.txt
cucumber-cpp/examples/Calc/CMakeLists.txt
cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt
In each of these, look where ${GTEST_LIBRARIES} are being added in the
call
Post by Alexis La Joie
to target_link_libraries.
As such you just need to add ${CMAKE_THREAD_LIBS_INIT} as the last
argument
Post by Alexis La Joie
in that call.
Original-> target_link_libraries(GTestCalculatorSteps Calc
${GTEST_LIBRARIES} ${CUKE_LIBRARIES})
Becomes-> target_link_libraries(GTestCalculatorSteps Calc
${GTEST_LIBRARIES}
Post by Alexis La Joie
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if(UNIX)
find_package(Threads) # GTest needs this and it's a static library
set(CUKE_TEST_LIBRARIES ${CUKE_TEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
endif()
The error is that it's not used everywhere! Thanks for spotting it.
Post by Alexis La Joie
I had the added pleasure of needing to do this in a Docker container
that I
Post by Alexis La Joie
was trying to build to install into an instance of cyber-dojo. In order
to
Post by Alexis La Joie
RUN git clone https://github.com/cucumber/cucumber-cpp.git
RUN sed -i 's/${GTEST_LIBRARIES})/${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})/g' cucumber-cpp/tests/CMakeLists.txt
RUN sed -i 's/${GTEST_LIBRARIES} ${CUKE_LIBRARIES})/${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})/g'
cucumber-cpp/examples/Calc/CMakeLists.txt
RUN sed -i 's/${GTEST_LIBRARIES} ${CUKE_LIBRARIES})/${GTEST_LIBRARIES}
${CUKE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})/g'
cucumber-cpp/examples/FeatureShowcase/CMakeLists.txt
This was obviously after I had already gotten all the required
dependencies
Post by Alexis La Joie
installed (hint: I did it based from the g++4.9 GoogleMock image to make
sure that GMock was already properly installed... after that I just
added
Post by Alexis La Joie
ruby, rspec, cucumber, etc...).
Travis CI builds every merge in Cucumber-CPP so it doesn't just "work
on my computer" ;-)
Can you share a dockerfile that shows the problem? It should be an easy fix.
Cheers,
Paolo
Post by Alexis La Joie
I hope this helps you and anyone else stuck like I was late last night.
Regards,
Alexis
Post by Lukács István
Hi Paolo,
Thank you for your answer!
Now, I istalled Boost 1.55.
Rebuild my previously downloaded gmock (1.6) with its gtest and copied
all
Post by Alexis La Joie
Post by Lukács István
the *.a files to /usr/lib.
(I removed my previously used gtest from /usr/src/gtest.)
The problem was the same.
Then I updated the /usr/include/gtest directory. As a result of this,
the
Post by Alexis La Joie
Post by Lukács István
...
[ 60%] Building CXX object
tests/CMakeFiles/CukeCommandsTest.dir/unit/CukeCommandsTest.cpp.o
Linking CXX executable CukeCommandsTest
[ 60%] Built target CukeCommandsTest
Scanning dependencies of target GTestDriverTest
[ 61%] Building CXX object
tests/CMakeFiles/GTestDriverTest.dir/integration/drivers/GTestDriverTest.cpp.o
Post by Alexis La Joie
Post by Lukács István
Linking CXX executable GTestDriverTest
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO
missing
Post by Alexis La Joie
Post by Lukács István
from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/GTestDriverTest] Error 1
make[1]: *** [tests/CMakeFiles/GTestDriverTest.dir/all] Error 2
make: *** [all] Error 2
If you have any idea, do not hesitate to answer. :)
BR,
Istvan
On Tue, Oct 21, 2014 at 12:59 PM, Lukács István
Post by Lukács István
Hi all,
I am trying to build cucumber-cpp on the basis of
"https://github.com/cucumber/cucumber-cpp".
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04
"cucumber-ruby-core" directory is in the Path.
the output of command "cmake -E chdir build cmake
-DCUKE_ENABLE_EXAMPLES=on
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
I can't compile Boost 1.54.0 with GCC 4.8.2 (perhaps because of
https://svn.boost.org/trac/boost/ticket/9766).
Post by Lukács István
-- thread
-- system
-- regex
-- date_time
-- unit_test_framework
-- Could NOT find CPPSPEC (missing: CPPSPEC_LIBRARY
CPPSPEC_INCLUDE_DIR)
-- Found GTest: /usr/lib/libgtest.a
-- Found GMock: /usr/src/gmock/libgmock.a
I suspect that the GTest library that CMake found is not the one in
GMock. It finds GTest in /usr/lib/libgtest.a but GMock from
/usr/src/gmock/libgmock.a.
Post by Lukács István
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
Could not find Bundler: skipping Ruby Gem management
-- Found Cucumber
-- Configuring done
-- Generating done
/home/s-dev/cucumber-cpp/cucumber-cpp-master/build
Scanning dependencies of target cucumber-cpp
[ 1%] Building CXX object
src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object
tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object
tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
function `testing::AssertionResult
testing::internal::CmpHelperEQ<int,
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
undefined reference to `testing::internal::EqFailure(char const*,
char
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
function `testing::AssertionResult
testing::internal::CmpHelperEQ<int,
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
undefined reference to `testing::internal::EqFailure(char const*,
char
Post by Alexis La Joie
Post by Lukács István
Post by Lukács István
const*, testing::internal::String const&, testing::internal::String const&,
bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2
Does somebody have any idea to solve this problem?
I am waiting for your answer!
Here you can find a script to download and compile Cucumber-CPP with
https://gist.github.com/paoloambrosio/f4007067b51ffb14e0d4
It uses Boost 1.55, GMock 1.6, GTest 1.6.
Paolo
Post by Lukács István
BR,
Istvan
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups
Post by Alexis La Joie
"Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Alexis La Joie
For more options, visit https://groups.google.com/d/optout.
--
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.
Continue reading on narkive:
Loading...