title: Building Boost.Coroutines2 examples
body: <p>I'm trying to build the Boost 1.59 coroutine and coroutine2 examples.<br>
  I built boost with b2 (complete build)  and am using CMake to generate a VC2015 project to build the samples.</p>
  
  <p>All the coroutine samples build and run just fine, but I get linking errors with the <em>coroutine2</em> samples.</p>
  
  <p>My <code>CMakeLists.txt</code> file is straightforward, just find boost, include the headers and link to the boost libs:</p>
  
  <pre><code>project (coroutines-samples)
  cmake_minimum_required(VERSION 2.8)
  
  
  find_package(Boost REQUIRED)
  include_directories(${Boost_INCLUDE_DIR})
  link_directories(${Boost_LIBRARY_DIRS})
  
  
  add_executable(chaining.cpp         /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/chaining.cpp)
  add_executable(echo.cpp             /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/echo.cpp)
  add_executable(exception.cpp        /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/exception.cpp)
  add_executable(fibonacci.cpp        /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/fibonacci.cpp)
  add_executable(layout.cpp           /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/layout.cpp)
  add_executable(parallel.cpp         /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/parallel.cpp)
  add_executable(power.cpp            /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/power.cpp)
  add_executable(same_fringe.cpp      /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/same_fringe.cpp)
  add_executable(segmented_stack.cpp  /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/segmented_stack.cpp)
  add_executable(simple.cpp           /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/simple.cpp)
  add_executable(unwind.cpp           /some/path/boost_1_59_0/libs/coroutine/example/cpp03/asymmetric/unwind.cpp)
  add_executable(dice_game.cpp        /some/path/boost_1_59_0/libs/coroutine/example/cpp03/symmetric/dice_game.cpp)
  add_executable(merge_arrays.cpp     /some/path/boost_1_59_0/libs/coroutine/example/cpp03/symmetric/merge_arrays.cpp)
  add_executable(segmented_stack1.cpp /some/path/boost_1_59_0/libs/coroutine/example/cpp03/symmetric/segmented_stack.cpp)
  add_executable(simple1.cpp          /some/path/boost_1_59_0/libs/coroutine/example/cpp03/symmetric/simple.cpp)
  add_executable(unwind1.cpp          /some/path/boost_1_59_0/libs/coroutine/example/cpp03/symmetric/unwind.cpp)
  add_executable(await_emu.cpp        /some/path/boost_1_59_0/libs/coroutine/example/cpp11/asymmetric/await_emu.cpp)
  add_executable(fibonacci11.cpp      /some/path/boost_1_59_0/libs/coroutine/example/cpp11/asymmetric/fibonacci.cpp)
  add_executable(iterator_range.cpp   /some/path/boost_1_59_0/libs/coroutine/example/cpp11/asymmetric/iterator_range.cpp)
  add_executable(layout11.cpp         /some/path/boost_1_59_0/libs/coroutine/example/cpp11/asymmetric/layout.cpp)
  add_executable(same_fringe11.cpp    /some/path/boost_1_59_0/libs/coroutine/example/cpp11/asymmetric/same_fringe.cpp)
  add_executable(merge_arrays1.cpp    /some/path/boost_1_59_0/libs/coroutine/example/cpp11/symmetric/merge_arrays.cpp)
  add_executable(simple2.cpp          /some/path/boost_1_59_0/libs/coroutine/example/cpp11/symmetric/simple.cpp)
  
  
  # coroutines2
  add_executable(coro2_fibonacci     /some/path/boost_1_59_0/libs/coroutine2/example/fibonacci.cpp)
  add_executable(coro2_layout        /some/path/boost_1_59_0/libs/coroutine2/example/layout.cpp)
  add_executable(coro2_parser        /some/path/boost_1_59_0/libs/coroutine2/example/parser.cpp)
  add_executable(coro2_same_fringe   /some/path/boost_1_59_0/libs/coroutine2/example/same_fringe.cpp)
  add_executable(coro2_segmented     /some/path/boost_1_59_0/libs/coroutine2/example/segmented.cpp)
  add_executable(coro2_simple        /some/path/boost_1_59_0/libs/coroutine2/example/simple.cpp)
  
  
  target_link_libraries(chaining.cpp        ${Boost_LIBRARIES})
  target_link_libraries(echo.cpp            ${Boost_LIBRARIES})
  target_link_libraries(exception.cpp       ${Boost_LIBRARIES})
  target_link_libraries(fibonacci.cpp       ${Boost_LIBRARIES})
  target_link_libraries(layout.cpp          ${Boost_LIBRARIES})
  target_link_libraries(parallel.cpp        ${Boost_LIBRARIES})
  target_link_libraries(power.cpp           ${Boost_LIBRARIES})
  target_link_libraries(same_fringe.cpp     ${Boost_LIBRARIES})
  target_link_libraries(segmented_stack.cpp ${Boost_LIBRARIES})
  target_link_libraries(simple.cpp          ${Boost_LIBRARIES})
  target_link_libraries(unwind.cpp          ${Boost_LIBRARIES})
  target_link_libraries(dice_game.cpp       ${Boost_LIBRARIES})
  target_link_libraries(merge_arrays.cpp    ${Boost_LIBRARIES})
  target_link_libraries(segmented_stack1.cpp ${Boost_LIBRARIES})
  target_link_libraries(simple1.cpp         ${Boost_LIBRARIES})
  target_link_libraries(unwind1.cpp         ${Boost_LIBRARIES})
  target_link_libraries(await_emu.cpp       ${Boost_LIBRARIES})
  target_link_libraries(fibonacci11.cpp     ${Boost_LIBRARIES})
  target_link_libraries(iterator_range.cpp  ${Boost_LIBRARIES})
  target_link_libraries(layout11.cpp        ${Boost_LIBRARIES})
  target_link_libraries(same_fringe11.cpp   ${Boost_LIBRARIES})
  target_link_libraries(merge_arrays1.cpp   ${Boost_LIBRARIES})
  target_link_libraries(simple2.cpp         ${Boost_LIBRARIES})
  
  
  target_link_libraries(coro2_fibonacci     ${Boost_LIBRARIES})
  target_link_libraries(coro2_layout        ${Boost_LIBRARIES})
  target_link_libraries(coro2_parser        ${Boost_LIBRARIES})
  target_link_libraries(coro2_same_fringe   ${Boost_LIBRARIES})
  target_link_libraries(coro2_segmented     ${Boost_LIBRARIES})
  target_link_libraries(coro2_simple        ${Boost_LIBRARIES})
  </code></pre>
  
  <p>The linked does not seem to be able to find boost::system::system_category.<br>
  This is my error log:</p>
  
  <pre><code>1&gt;------ Build started: Project: coro2_fibonacci, Configuration: Debug x64 ------
  
  2&gt;------ Build started: Project: coro2_layout, Configuration: Debug x64 ------
  
  3&gt;------ Build started: Project: coro2_parser, Configuration: Debug x64 ------
  
  4&gt;------ Build started: Project: coro2_same_fringe, Configuration: Debug x64 ------
  
  5&gt;------ Build started: Project: coro2_segmented, Configuration: Debug x64 ------
  
  6&gt;------ Build started: Project: coro2_simple, Configuration: Debug x64 ------
  
  1&gt;libboost_context-vc140-mt-gd-1_59.lib(stack_traits.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const &amp; __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QEAA@HPEBD@Z)
  
  1&gt;\some\path\Coroutines\build\vs2015.x64\Debug\coro2_fibonacci.exe : fatal error LNK1120: 1 unresolved externals
  
  4&gt;libboost_context-vc140-mt-gd-1_59.lib(stack_traits.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const &amp; __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QEAA@HPEBD@Z)
  
  4&gt;\some\path\Coroutines\build\vs2015.x64\Debug\coro2_same_fringe.exe : fatal error LNK1120: 1 unresolved externals
  
  6&gt;libboost_context-vc140-mt-gd-1_59.lib(stack_traits.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const &amp; __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QEAA@HPEBD@Z)
  
  2&gt;libboost_context-vc140-mt-gd-1_59.lib(stack_traits.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const &amp; __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QEAA@HPEBD@Z)
  
  3&gt;libboost_context-vc140-mt-gd-1_59.lib(stack_traits.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const &amp; __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QEAA@HPEBD@Z)
  
  5&gt;libboost_context-vc140-mt-gd-1_59.lib(stack_traits.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const &amp; __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QEAA@HPEBD@Z)
  
  6&gt;\some\path\Coroutines\build\vs2015.x64\Debug\coro2_simple.exe : fatal error LNK1120: 1 unresolved externals
  
  2&gt;\some\path\Coroutines\build\vs2015.x64\Debug\coro2_layout.exe : fatal error LNK1120: 1 unresolved externals
  
  3&gt;\some\path\Coroutines\build\vs2015.x64\Debug\coro2_parser.exe : fatal error LNK1120: 1 unresolved externals
  
  5&gt;\some\path\Coroutines\build\vs2015.x64\Debug\coro2_segmented.exe : fatal error LNK1120: 1 unresolved externals
  
  7&gt;------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------
  
  7&gt;Project not selected to build for this solution configuration 
  
  ========== Build: 0 succeeded, 6 failed, 25 up-to-date, 1 skipped ==========
  </code></pre>
  
  <p>What am I doing wrong?</p>