CMake"无法找到Boost"

时间:2014-04-16 09:21:58

标签: c++ c++11 boost makefile cmake

我正在使用CMAKE,我已将set(CMAKE_CXX_FLAGS“$ {CMAKE_CXX_FLAGS} -std = c ++ 11”)和add_definitions(“ - std = c ++ 11”)添加到CMakeLists.txt文件中,以便切换到c ++ 11。

cmake_minimum_required(VERSION 2.6.4)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ".")
set(PROJECT_DEMO_NAME ${PROJECT_NAME_STR}_demo)

file(GLOB DEMO_SRC_FILES ${PROJECT_SOURCE_DIR}/demo/*.cpp)
include_directories(${INCLUDES})
add_executable(${PROJECT_DEMO_NAME} ${DEMO_SRC_FILES})
target_link_libraries(${PROJECT_DEMO_NAME} ${LIBS} ${PROJECT_LIB_NAME})
add_dependencies(${PROJECT_DEMO_NAME} ${PROJECT_LIB_NAME})
add_definitions("-std=c++11")

set_property(
  TARGET ${PROJECT_DEMO_NAME}
  APPEND PROPERTY COMPILE_FLAGS ${PROJECT_COMPILER_FLAGS}) 

这就是我在运行“make”后得到的结果:

-- info CMAKE_BINARY_DIR: /home/cpp-driver-master
-- Could NOT find Boost
-- Configuring done
CMake Error: Unable to open check cache file for write. /home/cpp-driver-master/CMakeFiles/cmake.check_cache
make: *** [cmake_check_build_system] Error 1

我是C ++世界的新手,我不知道这里有什么问题!

感谢您的帮助!


做了“sudo chown / home / cpp-driver-master -R”之后:

-- info CMAKE_BINARY_DIR: /home/cpp-driver-master
-- Could NOT find Boost
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cpp-driver-master
[ 95%] Built target cql
Scanning dependencies of target cql_demo
[ 95%] Building CXX object demo/CMakeFiles/cql_demo.dir/main.cpp.o
In file included from /usr/include/boost/thread/pthread/condition_variable.hpp:10:0,
                 from /usr/include/boost/thread/condition_variable.hpp:16,
                 from /home/cpp-driver-master/include/cql/cql_connection.hpp:30,
                 from /home/cpp-driver-master/demo/Cassisam.h:3,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/thread/pthread/thread_data.hpp: In constructor ‘boost::detail::tss_data_node::tss_data_node(boost::shared_ptr<boost::detail::tss_cleanup_function>, void*)’:
/usr/include/boost/thread/pthread/thread_data.hpp:36:41: error: use of deleted function ‘boost::shared_ptr<boost::detail::tss_cleanup_function>::shared_ptr(const boost::shared_ptr<boost::detail::tss_cleanup_function>&)’
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/asio/detail/shared_ptr.hpp:23,
                 from /usr/include/boost/asio/detail/socket_ops.hpp:21,
                 from /usr/include/boost/asio/detail/socket_holder.hpp:20,
                 from /usr/include/boost/asio/detail/reactive_socket_accept_op.hpp:24,
                 from /usr/include/boost/asio/detail/reactive_socket_service.hpp:30,
                 from /usr/include/boost/asio/datagram_socket_service.hpp:26,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:21,
                 from /usr/include/boost/asio.hpp:20,
                 from /home/cpp-driver-master/demo/Cassisam.h:1,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: ‘boost::shared_ptr<boost::detail::tss_cleanup_function>::shared_ptr(const boost::shared_ptr<boost::detail::tss_cleanup_function>&)’ is implicitly declared as deleted because ‘boost::shared_ptr<boost::detail::tss_cleanup_function>’ declares a move constructor or move assignment operator
In file included from /usr/include/boost/exception/detail/exception_ptr.hpp:20:0,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/future.hpp:14,
                 from /home/cpp-driver-master/include/cql/cql_connection.hpp:31,
                 from /home/cpp-driver-master/demo/Cassisam.h:3,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/exception/info.hpp: In member function ‘virtual boost::shared_ptr<boost::exception_detail::error_info_base> boost::exception_detail::error_info_container_impl::get(const boost::exception_detail::type_info_&) const’:
/usr/include/boost/exception/info.hpp:102:28: error: use of deleted function ‘boost::shared_ptr<boost::exception_detail::error_info_base>::shared_ptr(const boost::shared_ptr<boost::exception_detail::error_info_base>&)’
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/asio/detail/shared_ptr.hpp:23,
                 from /usr/include/boost/asio/detail/socket_ops.hpp:21,
                 from /usr/include/boost/asio/detail/socket_holder.hpp:20,
                 from /usr/include/boost/asio/detail/reactive_socket_accept_op.hpp:24,
                 from /usr/include/boost/asio/detail/reactive_socket_service.hpp:30,
                 from /usr/include/boost/asio/datagram_socket_service.hpp:26,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:21,
                 from /usr/include/boost/asio.hpp:20,
                 from /home/cpp-driver-master/demo/Cassisam.h:1,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: ‘boost::shared_ptr<boost::exception_detail::error_info_base>::shared_ptr(const boost::shared_ptr<boost::exception_detail::error_info_base>&)’ is implicitly declared as deleted because ‘boost::shared_ptr<boost::exception_detail::error_info_base>’ declares a move constructor or move assignment operator
In file included from /home/cpp-driver-master/include/cql/cql_connection.hpp:31:0,
                 from /home/cpp-driver-master/demo/Cassisam.h:3,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/thread/future.hpp: In constructor ‘boost::detail::future_waiter::registered_waiter::registered_waiter(const boost::shared_ptr<boost::detail::future_object_base>&, std::list<boost::condition_variable_any*>::iterator, boost::detail::future_waiter::count_type)’:
/usr/include/boost/thread/future.hpp:407:79: error: use of deleted function ‘boost::shared_ptr<boost::detail::future_object_base>::shared_ptr(const boost::shared_ptr<boost::detail::future_object_base>&)’
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/asio/detail/shared_ptr.hpp:23,
                 from /usr/include/boost/asio/detail/socket_ops.hpp:21,
                 from /usr/include/boost/asio/detail/socket_holder.hpp:20,
                 from /usr/include/boost/asio/detail/reactive_socket_accept_op.hpp:24,
                 from /usr/include/boost/asio/detail/reactive_socket_service.hpp:30,
                 from /usr/include/boost/asio/datagram_socket_service.hpp:26,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:21,
                 from /usr/include/boost/asio.hpp:20,
                 from /home/cpp-driver-master/demo/Cassisam.h:1,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: ‘boost::shared_ptr<boost::detail::future_object_base>::shared_ptr(const boost::shared_ptr<boost::detail::future_object_base>&)’ is implicitly declared as deleted because ‘boost::shared_ptr<boost::detail::future_object_base>’ declares a move constructor or move assignment operator
In file included from /home/cpp-driver-master/include/cql/cql_connection.hpp:31:0,
                 from /home/cpp-driver-master/demo/Cassisam.h:3,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/thread/future.hpp: In member function ‘boost::unique_future<void> boost::promise<void>::get_future()’:
/usr/include/boost/thread/future.hpp:1134:46: error: use of deleted function ‘boost::shared_ptr<boost::detail::future_object<void> >::shared_ptr(const boost::shared_ptr<boost::detail::future_object<void> >&)’
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/asio/detail/shared_ptr.hpp:23,
                 from /usr/include/boost/asio/detail/socket_ops.hpp:21,
                 from /usr/include/boost/asio/detail/socket_holder.hpp:20,
                 from /usr/include/boost/asio/detail/reactive_socket_accept_op.hpp:24,
                 from /usr/include/boost/asio/detail/reactive_socket_service.hpp:30,
 ...
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/asio/detail/shared_ptr.hpp:23,
                 from /usr/include/boost/asio/detail/socket_ops.hpp:21,
                 from /usr/include/boost/asio/detail/socket_holder.hpp:20,
                 from /usr/include/boost/asio/detail/reactive_socket_accept_op.hpp:24,
                 from /usr/include/boost/asio/detail/reactive_socket_service.hpp:30,
                 from /usr/include/boost/asio/datagram_socket_service.hpp:26,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:21,
                 from /usr/include/boost/asio.hpp:20,
                 from /home/cpp-driver-master/demo/Cassisam.h:1,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: ‘boost::shared_ptr<boost::asio::ssl::detail::openssl_init<>::do_init>::shared_ptr(const boost::shared_ptr<boost::asio::ssl::detail::openssl_init<>::do_init>&)’ is implicitly declared as deleted because ‘boost::shared_ptr<boost::asio::ssl::detail::openssl_init<>::do_init>’ declares a move constructor or move assignment operator
In file included from /usr/include/c++/4.7/map:60:0,
                 from /usr/include/boost/date_time/gregorian/greg_month.hpp:18,
                 from /usr/include/boost/date_time/gregorian/greg_ymd.hpp:16,
                 from /usr/include/boost/date_time/gregorian/greg_calendar.hpp:16,
                 from /usr/include/boost/date_time/gregorian/gregorian_types.hpp:19,
                 from /usr/include/boost/date_time/posix_time/posix_time_config.hpp:18,
                 from /usr/include/boost/date_time/posix_time/posix_time_system.hpp:13,
                 from /usr/include/boost/date_time/posix_time/ptime.hpp:12,
                 from /usr/include/boost/date_time/posix_time/posix_time_types.hpp:12,
                 from /usr/include/boost/asio/time_traits.hpp:21,
                 from /usr/include/boost/asio/detail/timer_queue.hpp:27,
                 from /usr/include/boost/asio/detail/deadline_timer_service.hpp:28,
                 from /usr/include/boost/asio/deadline_timer_service.hpp:20,
                 from /usr/include/boost/asio/basic_deadline_timer.hpp:21,
                 from /usr/include/boost/asio.hpp:21,
                 from /home/cpp-driver-master/demo/Cassisam.h:1,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/c++/4.7/bits/stl_tree.h: In instantiation of ‘std::_Rb_tree_node<_Val>::_Rb_tree_node(_Args&& ...) [with _Args = {const std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >&}; _Val = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >]’:
/usr/include/c++/4.7/ext/new_allocator.h:110:4:   required from ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; _Args = {const std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >&}; _Tp = std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >]’
/usr/include/c++/4.7/bits/stl_tree.h:405:8:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {const std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >&}; _Key = boost::exception_detail::type_info_; _Val = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >; _KeyOfValue = std::_Select1st<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; _Compare = std::less<boost::exception_detail::type_info_>; _Alloc = std::allocator<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >*]’
/usr/include/c++/4.7/bits/stl_tree.h:427:55:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_clone_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = boost::exception_detail::type_info_; _Val = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >; _KeyOfValue = std::_Select1st<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; _Compare = std::less<boost::exception_detail::type_info_>; _Alloc = std::allocator<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >*; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >*]’
/usr/include/c++/4.7/bits/stl_tree.h:1044:43:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_copy(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type) [with _Key = boost::exception_detail::type_info_; _Val = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >; _KeyOfValue = std::_Select1st<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; _Compare = std::less<boost::exception_detail::type_info_>; _Alloc = std::allocator<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >*; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >*]’
/usr/include/c++/4.7/bits/stl_tree.h:953:8:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::operator=(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&) [with _Key = boost::exception_detail::type_info_; _Val = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >; _KeyOfValue = std::_Select1st<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; _Compare = std::less<boost::exception_detail::type_info_>; _Alloc = std::allocator<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >]’
/usr/include/c++/4.7/bits/stl_map.h:260:2:   required from ‘std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key, _Tp, _Compare, _Alloc>::operator=(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = boost::exception_detail::type_info_; _Tp = boost::shared_ptr<boost::exception_detail::error_info_base>; _Compare = std::less<boost::exception_detail::type_info_>; _Alloc = std::allocator<std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> > >; std::map<_Key, _Tp, _Compare, _Alloc> = std::map<boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >]’
/usr/include/boost/exception/info.hpp:161:28:   required from here
/usr/include/c++/4.7/bits/stl_tree.h:139:49: error: use of deleted function ‘constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = const boost::exception_detail::type_info_; _T2 = boost::shared_ptr<boost::exception_detail::error_info_base>; std::pair<_T1, _T2> = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >]’
In file included from /usr/include/c++/4.7/utility:72:0,
                 from /usr/include/boost/config/no_tr1/utility.hpp:21,
                 from /usr/include/boost/config/select_stdlib_config.hpp:33,
                 from /usr/include/boost/config.hpp:40,
                 from /usr/include/boost/asio/detail/config.hpp:14,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:18,
                 from /usr/include/boost/asio.hpp:20,
                 from /home/cpp-driver-master/demo/Cassisam.h:1,
                 from /home/cpp-driver-master/demo/main.cpp:1:
/usr/include/c++/4.7/bits/stl_pair.h:119:17: note: ‘constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = const boost::exception_detail::type_info_; _T2 = boost::shared_ptr<boost::exception_detail::error_info_base>; std::pair<_T1, _T2> = std::pair<const boost::exception_detail::type_info_, boost::shared_ptr<boost::exception_detail::error_info_base> >]’ is implicitly deleted because the default definition would be ill-formed:
/usr/include/c++/4.7/bits/stl_pair.h:119:17: error: use of deleted function ‘boost::shared_ptr<boost::exception_detail::error_info_base>::shared_ptr(const boost::shared_ptr<boost::exception_detail::error_info_base>&)’
make[2]: *** [demo/CMakeFiles/cql_demo.dir/main.cpp.o] Error 1
make[1]: *** [demo/CMakeFiles/cql_demo.dir/all] Error 2
make: *** [all] Error 2

0 个答案:

没有答案