title: Linking troubles with boost::program_options on OSX using LLVM
body: <p>I'm having trouble getting through the linking phase in my C++ program due to problems with Boost 1.49. I have switched to C++ (<code>-std=c++11 -libc=libc++</code>) which works fine for another piece of code (which also uses boost). Boost was installed using homebrew with:</p>
  
  <pre><code>brew install boost --universal --with-mpi --with-icu
  </code></pre>
  
  <p>The trouble starts with <code>boost::program_options</code>. I get the link errors like this:</p>
  
  <pre><code>  "boost::program_options::validate(boost::any&amp;, std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;*, int)", referenced from:
  
  ... etc. ...
  
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>This is a little strange, because doing an nm on the library used reveals, that the symbol appears to be there:</p>
  
  <pre><code>nm -U /usr/local/lib/libboost_program_options-mt.dylib  | grep validate
  0000000000019880 - 01 0000   FUN __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISbIwSt11char_traitsIwESaIwEESaIS7_EEPSsi
  0000000000019880 T __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISbIwSt11char_traitsIwESaIwEESaIS7_EEPSsi
  00000000000199e0 - 01 0000   FUN __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISbIwSt11char_traitsIwESaIwEESaIS7_EEPbi
  00000000000199e0 T __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISbIwSt11char_traitsIwESaIwEESaIS7_EEPbi
  0000000000019930 T __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISsSaISsEEPSsi
  0000000000019930 - 01 0000   FUN __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISsSaISsEEPSsi
  0000000000019c70 - 01 0000   FUN __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISsSaISsEEPbi
  0000000000019c70 T __ZN5boost15program_options8validateERNS_3anyERKSt6vectorISsSaISsEEPbi
  </code></pre>
  
  <p>I have already tried coaxing homebrew to compile boost with clang instead of gcc by setting CXX and CXX_FLAGS accordingly prior to installation. Not sure I succeeded though. </p>
  
  <p>Pointers greatly appreciated.</p>