<?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[undefined reference to _imp_]]></title><description><![CDATA[<p dir="auto">Dear Forum,</p>
<p dir="auto">I know that there are forum posts with similar topics but I did not found a solution so far.</p>
<p dir="auto">I have an external .lib to include to my project. I am using MinGW 64bit and Qt 5.15.0<br />
I used the function "Add Library", selected external and selected the .lib.</p>
<pre><code>unix:!macx|win32: LIBS += -L$$PWD/./ -llibe9u_LSMD_x64

INCLUDEPATH += $$PWD/.
DEPENDPATH += $$PWD/.
</code></pre>
<p dir="auto">Now I get multiple "undefinde reference to <em>imp</em>" errors. The supplier of the lib says that it was created using a cross compiler.</p>
<p dir="auto">I found this:<br />
<a href="https://stackoverflow.com/questions/30767553/undefined-reference-when-using-c11-qmake-flags" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/30767553/undefined-reference-when-using-c11-qmake-flags</a></p>
<p dir="auto">And added:</p>
<pre><code>QMAKE_CXXFLAGS += -std=c++11
CONFIG += c++11
</code></pre>
<p dir="auto">But that did not help.</p>
<p dir="auto">The lib works with Visual Studio. I also tried Qt VS Tools, but that also generated LNK2019 errors.</p>
<p dir="auto">Any help appreciated.</p>
<p dir="auto">Thanks!<br />
Dan</p>
]]></description><link>https://forum.qt.io/topic/134430/undefined-reference-to-_imp_</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 10:17:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/134430.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Feb 2022 20:27:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to undefined reference to _imp_ on Sat, 19 Feb 2022 14:00:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dansab">@<bdi>dansab</bdi></a> said in <a href="/post/703287">undefined reference to _imp_</a>:</p>
<blockquote>
<p dir="auto">Shouldn't a C or C++ compiler be able to recognize this?</p>
</blockquote>
<p dir="auto">How? You told the compiler that you're using a c++ function, but the library only exported the c name - how should a linker (not compiler btw) know about this - these are two different symbols for them.</p>
]]></description><link>https://forum.qt.io/post/703290</link><guid isPermaLink="true">https://forum.qt.io/post/703290</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sat, 19 Feb 2022 14:00:35 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference to _imp_ on Sat, 19 Feb 2022 13:17:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi JonB,</p>
<p dir="auto">the problem was, that some .h were written in C, so this problem was solved by</p>
<pre><code>extern "C"
{
#include...
}
</code></pre>
<p dir="auto">This error message is incredible unspecific...<br />
Shouldn't a C or C++ compiler be able to recognize this?</p>
<p dir="auto">cheers,<br />
Dan</p>
]]></description><link>https://forum.qt.io/post/703287</link><guid isPermaLink="true">https://forum.qt.io/post/703287</guid><dc:creator><![CDATA[dansab]]></dc:creator><pubDate>Sat, 19 Feb 2022 13:17:05 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference to _imp_ on Thu, 17 Feb 2022 20:31:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dansab">@<bdi>dansab</bdi></a><br />
Are these <code>.lib</code> files giving "imp..." warnings from MSVC and you are trying to link them with MinGW?</p>
]]></description><link>https://forum.qt.io/post/703071</link><guid isPermaLink="true">https://forum.qt.io/post/703071</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 17 Feb 2022 20:31:59 GMT</pubDate></item></channel></rss>