title: Linker errors with Boost on Mac (OSX 10.10.02 | Xcode 6.1.1)
body: <p>Recently I started working with Boost on Windows for a project. It needs to be cross-platform so I also installed it on Mac. Unfortunately; whenever I add it to the Xcode project it gives me a big slew of linker-errors and conversion-warnings.</p>
  
  <p>Example of one of the linker-errors:</p>
  
  <blockquote>
    <p>Undefined symbols for architecture x86_64:<br>
    "boost::system::system_category()", referenced from:
          ___cxx_global_var_init2 in main.o
          boost::asio::error::get_system_category() in main.o
          boost::system::error_code::error_code() in main.o   "boost::system::generic_category()", referenced from:
          ___cxx_global_var_init in main.o
          ___cxx_global_var_init1 in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
    1 (use -v to see invocation)</p>
  </blockquote>
  
  <p>Example of one of the conversion-warnings:</p>
  
  <blockquote>
    <p>In file included from
    /usr/local/Cellar/boost/1.57.0/include/boost/date_time/posix_time/posix_time_types.hpp:16:
    /usr/local/Cellar/boost/1.57.0/include/boost/date_time/posix_time/posix_time_duration.hpp:24:21: warning: implicit conversion loses integer precision: 'long' to
    'hour_type' (aka 'int') [-Wshorten-64-to-32]
          time_duration(h,0,0)</p>
  </blockquote>
  
  <p>I tried several installation methods and configuration methods but it still won't work.</p>
  
  <p>These are my steps:</p>
  
  <ol>
  <li>Compile Boost or get a compiled version of Boost.</li>
  <li>Create an XCode project.</li>
  <li>Enter <a href="http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/tutorial/tuttimer1/src.html" rel="nofollow">this</a> sample code in the main class.</li>
  <li>Add the header and library paths to the Xcode project file.</li>
  <li>Build.</li>
  </ol>
  
  <p>Compile options I have tried:</p>
  
  <ul>
  <li>Compiling from source using <a href="http://www.boost.org/doc/libs/1_57_0/more/getting_started/unix-variants.html" rel="nofollow">the official guide</a>.</li>
  <li>Compiling from source using a few scripts I found here on Stackoverflow.</li>
  <li>Installing the brew package manager and downloading a package with binaries.</li>
  </ul>
  
  <p>Configuration options I have tried:</p>
  
  <ol>
  <li>Setting the header search path to /usr/local/Cellar/boost/1.57.0/include or equivalents and 
  setting the library search path to /usr/local/Cellar/boost/1.57.0/lib or the equivalents.</li>
  <li>Setting just the header search path but not the library path.</li>
  <li>Option 1 but recursive (causes more errors).</li>
  </ol>
  
  <p>I would appreciate it a lot if someone could point me in the right direction. I think it's something Xcode related since all of the compiled versions give me the same errors.</p>