<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot;]]></title><description><![CDATA[<p dir="auto">First post, so I hope i'm doing this correctly</p>
<p dir="auto">System: Windows 10, Qt Widgets application, QMake</p>
<p dir="auto">I am currently trying to add an open source project. The code can be found <a href="https://github.com/mit-nlp/MITIE" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/mit-nlp/MITIE</a>.</p>
<p dir="auto">I have built the library by:<br />
Ubuntu WSL running make.<br />
CMake GUI, Powershell with mingw32-make. I compiled with with the same gcc, g++, and mingw32-make that I am using in my project (located in my /Qt/Tools directory). I also used the CMake gui in the Qt tools.<br />
(Like so)<br />
<img src="https://ddgobkiprc33d.cloudfront.net/24ba56a4-2485-46d3-ab70-eed315f98514.PNG" alt="cmdRun.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">When I use the "add library" feature to point to the library files, the library will connect. It can recognize header files within the project.</p>
<p dir="auto">However, when I build or run the code, I get the following errors:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/3a0e20be-965d-4d99-a32d-ad5e1da53728.PNG" alt="buildErrors.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">I've spent about 25 hours trying/reading posts to do this, so I have some possible input to the solutions (however I am completely lost):<br />
The undefined reference is due to a mismatch of strings, namely the compiled cxx11 strings. I was confused that even though I used the same gcc and g++ files that this happened. <strong>I feel that this is the real problem, however I am stuck on how to solve this.</strong></p>
<p dir="auto">I am trying to create a wrapper using the Facade pattern to use MITIE from my Project. I set up two different libraries for testing, a shared and static. The shared library runs into the problems when building. The static library built my wrapper fine, but when I went to test it I ran into the same build problem (that little time when I thought it worked was a nice relief, but it was not too long before I realized that it was not working)<br />
It will also build in other sub directory projects, but when I go to run I will get the "undefined reference"</p>
<p dir="auto">So hopefully this post was informative enough to give you an overview of the problem.</p>
<p dir="auto">Here is my cmake gui file, in case there is something that i'm missing<br />
<img src="https://ddgobkiprc33d.cloudfront.net/6a9a15b2-95a5-4c08-8d4d-565648f7ba3f.PNG" alt="CMake.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/131632/mingw32-compiling-an-open-source-project-undefined-referece-to-cxx11_basic_str</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 08:05:11 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/131632.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Nov 2021 03:39:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot; on Sat, 06 Nov 2021 03:59:03 GMT]]></title><description><![CDATA[<p dir="auto">Another update. I compiled with the flag -Wabi-tag, and got the following errors:</p>
<pre><code>warning: 'const string dlib::get_stack_trace()' inherits the "cxx11" ABI tag that 'const string' {aka 'const std::__cxx11::basic_string&lt;char&gt;'} (used in its return type) has [-Wabi-tag]
</code></pre>
<pre><code>C:/Qt6.2/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/basic_string.h:77:11: note: 'const string' {aka 'const std::__cxx11::basic_string&lt;char&gt;'} declared here
     class basic_string
</code></pre>
<p dir="auto">Even if I compile with the flags, -D_GLIBCXX_USE_CXX11_ABI=1 OR -D_GLIBCXX_USE_CXX11_ABI=0, same bugs occur.</p>
<p dir="auto">I am going to manually add #define D_GLIBCXX_USE_CXX11_ABI=1 to the header files and will post results.</p>
<p dir="auto">Official GCC comment on dual ABI: <a href="https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/manual/using_dual_abi.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/manual/using_dual_abi.html</a></p>
<p dir="auto">EDIT: Compiling the flags with either value results in the same error ("cx11").</p>
]]></description><link>https://forum.qt.io/post/688709</link><guid isPermaLink="true">https://forum.qt.io/post/688709</guid><dc:creator><![CDATA[pjared]]></dc:creator><pubDate>Sat, 06 Nov 2021 03:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot; on Fri, 05 Nov 2021 23:47:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a><br />
Through the research that i've been doing, I believe that it is an ABI mismatch.<br />
A similar problem is from this stack overflow, <a href="https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring</a> . I have tried to implement the solutions but I'm not sure if i'm doing it correctly.</p>
]]></description><link>https://forum.qt.io/post/688705</link><guid isPermaLink="true">https://forum.qt.io/post/688705</guid><dc:creator><![CDATA[pjared]]></dc:creator><pubDate>Fri, 05 Nov 2021 23:47:14 GMT</pubDate></item><item><title><![CDATA[Reply to Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot; on Thu, 04 Nov 2021 00:56:33 GMT]]></title><description><![CDATA[<p dir="auto">It was a little too large for the forums. I hope that you can view it here.<br />
<a href="https://pastebin.com/21cFyyKH" target="_blank" rel="noopener noreferrer nofollow ugc">https://pastebin.com/21cFyyKH</a></p>
]]></description><link>https://forum.qt.io/post/688351</link><guid isPermaLink="true">https://forum.qt.io/post/688351</guid><dc:creator><![CDATA[pjared]]></dc:creator><pubDate>Thu, 04 Nov 2021 00:56:33 GMT</pubDate></item><item><title><![CDATA[Reply to Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot; on Wed, 03 Nov 2021 07:09:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pjared">@<bdi>pjared</bdi></a> said in <a href="/post/688023">Mingw32 Compiling an open source project "undefined referece to .. cxx11_basic_str"</a>:</p>
<blockquote>
<p dir="auto">Mingw32 Is generating a .dll and .dll.a, so i've been adding the .a file</p>
</blockquote>
<p dir="auto">.a is static lib, use the dll.<br />
Also, post the whole build log here (please as text!), so we can see what happens.</p>
]]></description><link>https://forum.qt.io/post/688109</link><guid isPermaLink="true">https://forum.qt.io/post/688109</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 03 Nov 2021 07:09:28 GMT</pubDate></item><item><title><![CDATA[Reply to Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot; on Tue, 02 Nov 2021 16:20:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> said in <a href="/post/687888">Mingw32 Compiling an open source project "undefined referece to .. cxx11_basic_str"</a>:</p>
<blockquote>
<p dir="auto">mitie::ner_trainer</p>
</blockquote>
<p dir="auto">As for adding ner_trainer, I have tried using both a static and dynamic library<br />
<img src="https://ddgobkiprc33d.cloudfront.net/29c5fa67-f275-443c-a7d5-8e9517038b07.PNG" alt="addingLib.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Mingw32 Is generating a .dll and .dll.a, so i've been adding the .a file</p>
<p dir="auto">As for the compilers, I have made sure that i'm using the same compilers that my project has been run on<br />
<img src="https://ddgobkiprc33d.cloudfront.net/1addff4b-a017-4205-94f5-afdc435f1d15.PNG" alt="Kit.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/4ddb2ea1-0346-4a2e-840d-a0a0ab2f66dd.PNG" alt="Compilers.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">I point the cmake to the same /tools file</p>
]]></description><link>https://forum.qt.io/post/688023</link><guid isPermaLink="true">https://forum.qt.io/post/688023</guid><dc:creator><![CDATA[pjared]]></dc:creator><pubDate>Tue, 02 Nov 2021 16:20:09 GMT</pubDate></item><item><title><![CDATA[Reply to Mingw32 Compiling an open source project &quot;undefined referece to .. cxx11_basic_str&quot; on Tue, 02 Nov 2021 06:38:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pjared">@<bdi>pjared</bdi></a> Did you add mitie::ner_trainer lib properly? Was this lib built using same compiler as you're using for your Qt project?</p>
]]></description><link>https://forum.qt.io/post/687888</link><guid isPermaLink="true">https://forum.qt.io/post/687888</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 02 Nov 2021 06:38:29 GMT</pubDate></item></channel></rss>