title: Linker Error when building Xcode project using external library
body: <p>I am attempting to build a very simple command line application, in Xcode, that will print out basic information about MXF video files. In order to do this I need to use the libmxf, libbmx, and libbmx libraries available for download here: </p>
  
  <p><a href="http://sourceforge.net/p/bmxlib/home/Home/" rel="noreferrer">http://sourceforge.net/p/bmxlib/home/Home/</a></p>
  
  <p>My C++ code is incredibly simple at this point:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  #include &lt;cstring&gt;
  #include &lt;cerrno&gt;
  #include &lt;vector&gt;
  
  #include &lt;bmx/mxf_reader/MXFFileReader.h&gt;
  #include &lt;bmx/mxf_reader/MXFGroupReader.h&gt;
  #include &lt;bmx/mxf_reader/MXFSequenceReader.h&gt;
  #include &lt;bmx/mxf_reader/MXFFrameMetadata.h&gt;
  #include &lt;bmx/MXFUtils.h&gt;
  #include &lt;bmx/Utils.h&gt;
  
  using namespace std;
  using namespace bmx;
  
  #define MXF_OPEN_READ(fn, pf)   mxf_disk_file_open_read(fn, pf)
  
  int main(int argc, const char * argv[])
  {
      std::vector&lt;const char *&gt; filenames;
      std::cout &lt;&lt; "mxfheader: execution beginning...\n";
      for (int cmdln_index = 0; cmdln_index &lt; argc; cmdln_index++) {
          if (!check_file_exists(argv[cmdln_index])) {
              if (argv[cmdln_index][0] == '-') {
                  fprintf(stderr, "Unknown argument '%s'\n", argv[cmdln_index]);
              } else {
                  fprintf(stderr, "Failed to open input filename '%s'\n", argv[cmdln_index]);
              }
              return 1;
          }
          filenames.push_back(argv[cmdln_index]);
      }
  
      std::cout &lt;&lt; filenames[0] &lt;&lt; "\n";
      return 0;
  }
  </code></pre>
  
  <p>When I compiled the BMX library, I was sure to run configure with 64-bit support, like so:</p>
  
  <pre><code>./configure --build=x86_64-apple-darwin11.4.2 --host=x86_64-apple-darwin11.4.2 CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" CC=clang CXX=clang++
  </code></pre>
  
  <p>In the XCode Project under Build Settings, I have added /usr/local/lib to my Search Paths. Under Build Phases, I have added "libbmx-0.1.3.dylib", "libMXF-1.0.4.dylib", and "libMXF++-1.0.4.dylib" to the "Link Binary With Libraries" section.</p>
  
  <p>I have verified that these libraries are, indeed, 64-bit ( file libbmx-0.1.3.dylib returns libbmx-0.1.3.dylib: Mach-O 64-bit dynamically linked shared library x86_64 ). </p>
  
  <p>Every time I try and build the application, I get the following linker error:</p>
  
  <pre><code>Ld /Users/ned/Library/Developer/Xcode/DerivedData/mxfheader-bkwawmplsoqpdadfxartceqkbolo/Build/Products/Debug/mxfheader normal x86_64
      cd /Users/ned/Documents/src/mxfheader
      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/ned/Library/Developer/Xcode/DerivedData/mxfheader-bkwawmplsoqpdadfxartceqkbolo/Build/Products/Debug -L/usr/local/lib -F/Users/ned/Library/Developer/Xcode/DerivedData/mxfheader-bkwawmplsoqpdadfxartceqkbolo/Build/Products/Debug -filelist /Users/ned/Library/Developer/Xcode/DerivedData/mxfheader-bkwawmplsoqpdadfxartceqkbolo/Build/Intermediates/mxfheader.build/Debug/mxfheader.build/Objects-normal/x86_64/mxfheader.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -lbmx-0.1.3 -lMXF-1.0.4 -lMXF++-1.0.4 -o /Users/ned/Library/Developer/Xcode/DerivedData/mxfheader-bkwawmplsoqpdadfxartceqkbolo/Build/Products/Debug/mxfheader
  
  Undefined symbols for architecture x86_64:
    "bmx::check_file_exists(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;)", referenced from:
        _main 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)
  </code></pre>
  
  <p>Any help would be appreciated. Thanks!</p>