title: Linking c++ libraries (for Wt) in Xcode
body: <p>I'm sorry to ask a question that resurfaces all over the place in different forms, but this has me tearing my hair out and I've tried every suggestion from all the dark corners of the internet. </p>
  
  <p>I'm trying to use the Wt framework (for web based c++ applications) with Xcode. Its header files are at /usr/local/include and its library files (and boost's) are at /usr/local/lib. I can compile at the terminal with </p>
  
  <pre><code>gcc -o hello testWt.cpp -lstdc++ -lwt.3.3.0 -lwthttp.3.3.0 -lboost_random -lboost_regex -lboost_signals -lboost_system -lboost_thread -lboost_filesystem -lboost_program_options -lboost_date_time
  </code></pre>
  
  <p>but within Xcode I've had no luck. I've tried:</p>
  
  <ul>
  <li>Adding -I/usr/local/include to the <code>OTHER_C++_FLAGS</code> option</li>
  <li>Adding /usr/local/lib to the <code>Library Search Paths</code> option</li>
  <li>Adding /usr/local/include to <code>Header Search Paths</code></li>
  <li>Dragging all the libraries (both the .dylib and/or the .a versions) into the "Link Binary with Libraries" section</li>
  <li>All combinations of the above</li>
  </ul>
  
  <p>Now, I'm bashing my head against this linker error:</p>
  
  <pre><code>Ld /Users/charles/Library/Developer/Xcode/DerivedData/Test-dzrqjofmpnjowvcwtscacpwnhtqw/Build/Products/Debug/Test normal x86_64
  cd /Users/charles/tmp/Test
  setenv MACOSX_DEPLOYMENT_TARGET 10.7
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/charles/Library/Developer/Xcode/DerivedData/Test-dzrqjofmpnjowvcwtscacpwnhtqw/Build/Products/Debug -L/usr/local/lib -F/Users/charles/Library/Developer/Xcode/DerivedData/Test-dzrqjofmpnjowvcwtscacpwnhtqw/Build/Products/Debug -filelist /Users/charles/Library/Developer/Xcode/DerivedData/Test-dzrqjofmpnjowvcwtscacpwnhtqw/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/Test.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -lwt.3.3.0 -lwthttp.3.3.0 -lboost_atomic -lboost_chrono -lboost_context -lboost_date_time -lboost_exception -lboost_filesystem -lboost_graph -lboost_iostreams -lboost_locale -lboost_math_c99 -lboost_math_c99f -lboost_math_c99l -lboost_math_tr1 -lboost_math_tr1f -lboost_math_tr1l -lboost_prg_exec_monitor -lboost_program_options -lboost_python -lboost_random -lboost_regex -lboost_serialization -lboost_signals -lboost_system -lboost_test_exec_monitor -lboost_thread -lboost_timer -lboost_unit_test_framework -lboost_wave -lboost_wserialization -o /Users/charles/Library/Developer/Xcode/DerivedData/Test-dzrqjofmpnjowvcwtscacpwnhtqw/Build/Products/Debug/Test
  
  Undefined symbols for architecture x86_64:
  
    "Wt::WApplication::makeAbsoluteUrl(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) const", referenced from:
    vtable for HelloApplication in main.o
  
  ld: symbol(s) not found for architecture x86_64
  </code></pre>
  
  <p>Further than this I cannot get. This is the first time I've used Xcode for development so I may be missing something obvious; I'd be incredibly grateful if someone could point it out!</p>