Undefined reference to std::__cxx11:: errors (Bash on Ubuntu on Windows)
<p>Windows 10 Anniversary Update came out a couple of months ago, and I'm trying out the new "<strong>Bash on Ubuntu on Windows</strong>" feature.</p>

<p>I used it to compile some of my previous projects (finished on a normal Ubuntu machine), and while most of them were successfully built, a few of them received multiple <code>undefined reference to ... (std::__cxx11::...</code>  errors when <strong>building the entire project</strong> (after compilations on separate files are done without errors).</p>

<p>I tried switching to g++-4.8, g++-4.9, g++-5.4 and g++-6.2 and all of them came down to the same result. I also tried adding compiler option <code>-D_GLIBCXX_USE_CXX11_ABI=0</code>/<code>-D_GLIBCXX_USE_CXX11_ABI=1</code> in <em>Makefile</em> and still ended up with the same errors.</p>

<p>Here are parts of these error messages:</p>

<pre><code>&gt; building cirTest...
../../lib/libcmd.a(cmdCommon.o): In function `HistoryCmd::exec(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)':
cmdCommon.cpp:(.text+0xb3): undefined reference to `myStr2Int(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int&amp;)'
../../lib/libcmd.a(cmdCommon.o): In function `HelpCmd::exec(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)':
cmdCommon.cpp:(.text+0x91d): undefined reference to `std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_M_create(unsigned long&amp;, unsigned long)'
../../lib/libcmd.a(cmdCommon.o): In function `UsageCmd::exec(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)':
cmdCommon.cpp:(.text+0xd5c): undefined reference to `myStrNCmp(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned int)'
cmdCommon.cpp:(.text+0xdb9): undefined reference to `myStrNCmp(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned int)'
cmdCommon.cpp:(.text+0xe68): undefined reference to `myStrNCmp(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned int)'
../../lib/libcmd.a(cmdCommon.o): In function `QuitCmd::exec(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)':
cmdCommon.cpp:(.text+0x1190): undefined reference to `std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::find_first_not_of(char, unsigned long) const'
cmdCommon.cpp:(.text+0x126f): undefined reference to `myStrNCmp(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned int)'
cmdCommon.cpp:(.text+0x1320): undefined reference to `std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_M_assign(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)'
</code></pre>

<p>Since most of my projects did build successfully, I wonder if it's possible to solve the problem by toggling some settings without jumping to the conclusion that this is simply a result of "Bash on Ubuntu on Windows" still being a "beta" feature.</p>