<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hello all,</div><div class=""><br class=""></div><div class="">I’m trying to use the docopt.cpp parser for my project[1]:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/docopt/docopt.cpp" class="">https://github.com/docopt/docopt.cpp</a></div><div class=""><br class=""></div><div class="">The usual invocation to build works:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(52, 187, 199);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">┌─[</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">adam</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">Hapkido</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">±</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][docopt </span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""><b class="">✗</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][</span>~/CDT-plusplus/src/docopt<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">]</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">└─▪ clang++ --std=c++11 --stdlib=libc++ -I . docopt.cpp examples/naval_fate.cpp -o naval_fate</div></div><div class=""><br class=""></div><div class="">So, I want to add docopt.cpp and have the compiler look for header files in the same directory, and add that to my executable.</div><div class=""><br class=""></div><div class="">So far, what I’ve attempted is to add the lines:</div><div class=""><br class=""></div><div class=""><div class="">include_directories (BEFORE "src/docopt")</div><div class="">add_library(docopt.cpp "src/docopt/docopt.cpp”)</div></div><div class=""><br class=""></div><div class="">My program uses CGAL[2], and all of those library headers are incorporated using the create_single_source_cgal_program function in the CGAL_CreateSingleSourceCGALProgram.cmake module.</div><div class=""><br class=""></div><div class="">The error messages I’m getting correspond to the ones I get when docopt.cpp is not included:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(52, 187, 199);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">┌─[</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">adam</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">Hapkido</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">±</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][docopt </span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""><b class="">✗</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">][</span>~/CDT-plusplus/src/docopt<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">]</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">└─▪ clang++ --std=c++11 --stdlib=libc++ -I . examples/naval_fate.cpp -o naval_fate</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Undefined symbols for architecture x86_64:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">  "docopt::docopt(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">      _main in naval_fate-780283.o</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">  "docopt::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, docopt::value const&)", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">      _main in naval_fate-780283.o</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">ld: symbol(s) not found for architecture x86_64</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)</div></div><br class=""><div class="">Compare to:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">┌─[<span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">adam</b></span>][<span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">Hapkido</span>][<span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class=""><b class="">±</b></span>][docopt <span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""><b class="">✗</b></span>][<span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">~/CDT-plusplus</span>]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">└─▪ ./build.sh </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- The C compiler identification is AppleClang 6.0.0.6000054</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- The CXX compiler identification is AppleClang 6.0.0.6000054</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Check for working C compiler using: Ninja</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Check for working C compiler using: Ninja -- works</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Detecting C compiler ABI info</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Detecting C compiler ABI info - done</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Check for working CXX compiler using: Ninja</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Check for working CXX compiler using: Ninja -- works</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Detecting CXX compiler ABI info</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Detecting CXX compiler ABI info - done</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Build type: Release</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- USING CXXFLAGS = ' -O3 -DNDEBUG'</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- USING EXEFLAGS = '  -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib '</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Targetting Ninja</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Using /usr/bin/c++ compiler.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- DARWIN_VERSION=14</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Mac Leopard detected</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Requested component: Core</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Requested component: MPFR</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Requested component: GMP</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.2.2", minimum required is "3.1.0") </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Configuring done</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Generating done</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">-- Build files have been written to: /Users/adam/CDT-plusplus/build</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">[10/13] Linking CXX executable cdt-docopt</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">FAILED: : && /usr/bin/c++   -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib CMakeFiles/cdt-docopt.dir/src/cdt-docopt.cpp.o  -o cdt-docopt -L/Users/adam/gmock-1.7.0/lib/.libs  -L/Users/adam/gmock-1.7.0/gtest/lib/.libs /usr/local/lib/libmpfr.dylib /usr/local/lib/libgmp.dylib /usr/local/lib/libCGAL_Core.dylib /usr/local/lib/libCGAL.dylib /usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_system-mt.dylib /usr/local/lib/libCGAL_Core.dylib /usr/local/lib/libCGAL.dylib /usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_system-mt.dylib -Wl,-rpath,/Users/adam/gmock-1.7.0/lib/.libs -Wl,-rpath,/Users/adam/gmock-1.7.0/gtest/lib/.libs && :</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">Undefined symbols for architecture x86_64:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">  "docopt::docopt(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">      _main in cdt-docopt.cpp.o</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">  "docopt::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, docopt::value const&)", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">      _main in cdt-docopt.cpp.o</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">ld: symbol(s) not found for architecture x86_64</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">[10/13] Building CXX object CMakeFiles/unittests.dir/unittests/Triangulated2SphereTest.cpp.o</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">ninja: build stopped: subcommand failed.</div></div><div class=""><br class=""></div><div class="">Any suggestions?</div><div class=""><br class=""></div><div class="">[1] <a href="https://github.com/acgetchell/CDT-plusplus/tree/docopt" class="">https://github.com/acgetchell/CDT-plusplus/tree/docopt</a></div><div class="">[2] <a href="https://www.cgal.org" class="">https://www.cgal.org</a></div><div class=""><br class=""></div><div apple-content-edited="true" class="">
<div class="">Adam Getchell<br class=""><a href="http://about.me/adamgetchell" class="">about.me/adamgetchell</a></div>

</div>
<br class=""></body></html>