Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail to build #225

Closed
AlexanderAmelkin opened this issue Feb 19, 2019 · 3 comments · Fixed by #226
Closed

Tests fail to build #225

AlexanderAmelkin opened this issue Feb 19, 2019 · 3 comments · Fixed by #226

Comments

@AlexanderAmelkin
Copy link

While developing a solution to #88 I encountered a problem with the tests. I can't build them.
Here is what I do:

CLI11 $ $ git status   
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
CLI11 $ $ git submodule update --init
Submodule 'extern/googletest' (git@github.com:google/googletest.git) registered for path 'extern/googletest'
Submodule 'extern/json' (git@github.com:nlohmann/json.git) registered for path 'extern/json'
Submodule 'extern/sanitizers' (git@github.com:arsenm/sanitizers-cmake) registered for path 'extern/sanitizers'
Submodule path 'extern/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
Submodule path 'extern/json': checked out 'db53bdac1926d1baebcb459b685dcd2e4608c355'
Submodule path 'extern/sanitizers': checked out '6947cff3a9c9305eb9c16135dd81da3feb4bf87f'
CLI11 $ mkdir build
CLI11 $ cd build
build $ cmake ..
-- The CXX compiler identification is GNU 8.1.0
-- 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 8.1.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.12") 
-- Looking for pthread.h
-- Looking for 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  
-- Boost version: 1.58.0
-- Configuring done
WARNING: Target "informational" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/spirit/src/community/CLI11/build
build $ make
Scanning dependencies of target gtest
[  1%] Building CXX object extern/googletest/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[  2%] Linking CXX static library libgtest.a
[  2%] Built target gtest
...
Scanning dependencies of target OptionalTest
[ 42%] Building CXX object tests/CMakeFiles/OptionalTest.dir/OptionalTest.cpp.o
...
/usr/include/boost/optional/optional.hpp:619:7: error: no matching function for call to 'boost::optional_detail::optional_base<int>::assign_value(std::__cxx11::basic_string<char>&, boost::optional_detail::optional_base<int>::is_reference_predicate)'
       assign_value(boost::forward<Expr>(expr), is_reference_predicate());
...
/usr/include/boost/optional/optional.hpp:608:7: error: cannot convert 'std::__cxx11::basic_string<char>' to 'boost::optional_detail::optional_base<int>::internal_type' {aka 'int'} in initialization
       new (m_storage.address()) internal_type(boost::forward<Expr>(expr)) ;

The full log is attached

@henryiii
Copy link
Collaborator

henryiii commented Feb 19, 2019

Testing this on a Boost docker with 1.59 and CMake 3.5:

WARNING: Target "informational" requests linking to directory "/usr/include/boost".  Targets may link only to libraries.  CMake is dropping the item.

Along with a different failure. I think that warning is telling; the link is not working properly. I bet your CMake version is a bit older, too?

I've fixed the error from CMake (obviously never ran it with a non-target version of FindBoost), but the actual error is troubling - lexical cast can't go from a string to a boost optional. Might need a newer version than 1.59.

@henryiii
Copy link
Collaborator

Boost 1.60 also fails with a similar error, Boost 1.61 works.

@henryiii
Copy link
Collaborator

Latest master should now work! It won't build the Boost Optional test because your Boost is too old, but everything else should build!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants