<div dir="ltr"><span class="Apple-style-span" style="font-family: Helvetica; ">Hey Guys,<br><br>just tried to create a new C++ Project using the Boost Library with CMake.<br>Everything works great using Unix Makefiles but building with Xcode failed.<br>
<br>Compiling works without problems but there are some problems linking with the boost library.<br><br>Line Location Tool:0: collect2: ld returned 1 exit status<br>Line Location Tool:0: symbol(s) not found<br>Line Location Tool:0: __ZN5boost15program_options19options_description21m_default_line_lengthE$non_lazy_ptr in first.o<br>
Line Location Tool:0: "boost::program_options::options_description::m_default_line_length", referenced from:<br>Line Location Tool:0: boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)in first.o<br>
Line Location Tool:0: "boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)", referenced from:<br>
<br>My (testing) CMakeLists.txt looks like this:<br><br>cmake_minimum_required(VERSION 2.6)<br>find_package(Boost 1.36 COMPONENTS program_options)<br>link_directories(${Boost_LIBRARY_DIRS})<br>include_directories(${Boost_INCLUDE_DIRS})<br>
add_executable(test first.cpp)<br>target_link_libraries(test ${Boost_LIBRARIES})<br><br>I tried to compile the first program_options example from the boost package (also attached).<br><br>Software I'm using:<br><br>MacOS 10.5.4 Intel<br>
XCode 3.1.1<br>CMake 2.6.1<br>Boost 1.36.0<br><br>Anybody can help me out using Boost within cMake?<br><br>Best regards,<br>Stefan</span><br></div>