<?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[Linker error caused by Qt qjpeg4]]></title><description><![CDATA[<p dir="auto">I cannot link my project because of some issues with the qjpeg4 library.</p>
<p dir="auto">Its DLL is located here:</p>
<p dir="auto">@MY_PROJECT_ROOT/../Release/obj/imageformats/qjpeg4.dll@</p>
<p dir="auto">I get this linker error:</p>
<p dir="auto">@Linking CXX executable test.exe<br />
CMakeFiles\test.dir/objects.a(entrypoint.cpp.obj):entrypoint.cpp:(.text.startup+0x2692): undefined reference to `qt_plugin_instance_qjpeg()'<br />
collect2: ld returned 1 exit status<br />
@</p>
<p dir="auto">In the file containing main() I have: @Q_IMPORT_PLUGIN(qjpeg)@</p>
<p dir="auto">I tried adding these lines, with no improvement:</p>
<p dir="auto">@QApplication app(argc, argv);<br />
QString sDir = QCoreApplication::applicationDirPath();<br />
app.addLibraryPath(sDir + "/plugins");@</p>
<p dir="auto">The previous error should even not depend on the fact that the DLL has not been found, since it is still in the link phase...</p>
<p dir="auto">If in the file containing main() I remove Q_IMPORT_PLUGIN(qjpeg), the linker is successful, but the executable does absolutely nothing.</p>
<p dir="auto">The only Qt headers I include are &lt;QApplication&gt; and &lt;QtPlugin&gt;; adding &lt;QtGui&gt; has been useless.</p>
<p dir="auto">I am using cmake, and this is the token of my CMakeLists.txt file relative to Qt:</p>
<p dir="auto">@find_package(Qt4 REQUIRED)<br />
include(${QT_USE_FILE})<br />
add_definitions(${QT_DEFINITIONS})<br />
set(useQt_HEADERS )<br />
set(useQt_SOURCES entrypoint.cpp source.cpp)<br />
QT4_WRAP_CPP(useQt_HEADERS_MOC ${useQt_HEADERS})<br />
...<br />
target_link_libraries(myProject ${QT_LIBRARIES} )<br />
@</p>
]]></description><link>https://forum.qt.io/topic/29898/linker-error-caused-by-qt-qjpeg4</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 12:39:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/29898.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Jul 2013 08:13:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Linker error caused by Qt qjpeg4 on Fri, 26 Jul 2013 15:10:16 GMT]]></title><description><![CDATA[<p dir="auto">From this link, it seems to be a bug in Qt:</p>
<p dir="auto">"<a href="https://bugreports.qt-project.org/browse/QTBUG-24177" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt-project.org/browse/QTBUG-24177</a>":<a href="https://bugreports.qt-project.org/browse/QTBUG-24177" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt-project.org/browse/QTBUG-24177</a></p>
]]></description><link>https://forum.qt.io/post/188044</link><guid isPermaLink="true">https://forum.qt.io/post/188044</guid><dc:creator><![CDATA[pietrom]]></dc:creator><pubDate>Fri, 26 Jul 2013 15:10:16 GMT</pubDate></item><item><title><![CDATA[Reply to Linker error caused by Qt qjpeg4 on Thu, 25 Jul 2013 09:05:30 GMT]]></title><description><![CDATA[<p dir="auto">I removed<br />
@Q_IMPORT_PLUGIN(qjpeg)@</p>
<p dir="auto">Now it links.</p>
<p dir="auto">When I launch the executable (both from the command line and from the GUI), I get absolutely nothing. The main() function is not even entered. No error messages either.</p>
]]></description><link>https://forum.qt.io/post/187762</link><guid isPermaLink="true">https://forum.qt.io/post/187762</guid><dc:creator><![CDATA[pietrom]]></dc:creator><pubDate>Thu, 25 Jul 2013 09:05:30 GMT</pubDate></item><item><title><![CDATA[Reply to Linker error caused by Qt qjpeg4 on Thu, 25 Jul 2013 08:59:05 GMT]]></title><description><![CDATA[<p dir="auto">Please remove the following code you added too.</p>
<p dir="auto">@<br />
Q_IMPORT_PLUGIN(qjpeg)<br />
@</p>
]]></description><link>https://forum.qt.io/post/187756</link><guid isPermaLink="true">https://forum.qt.io/post/187756</guid><dc:creator><![CDATA[dbzhang800]]></dc:creator><pubDate>Thu, 25 Jul 2013 08:59:05 GMT</pubDate></item><item><title><![CDATA[Reply to Linker error caused by Qt qjpeg4 on Thu, 25 Jul 2013 08:54:55 GMT]]></title><description><![CDATA[<p dir="auto">All I could remove from my code was:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qstring">@<bdi>QString</bdi></a> sDir = QCoreApplication::applicationDirPath();<br />
app.addLibraryPath(sDir + "/plugins");@</p>
<p dir="auto">In CMakeLists.txt there is nothing related to the qjpg4 plugin, just general Qt stuff.<br />
In the file containing the main() function, I #include &lt;QtPlugin&gt;.<br />
Same behaviour.</p>
]]></description><link>https://forum.qt.io/post/187754</link><guid isPermaLink="true">https://forum.qt.io/post/187754</guid><dc:creator><![CDATA[pietrom]]></dc:creator><pubDate>Thu, 25 Jul 2013 08:54:55 GMT</pubDate></item><item><title><![CDATA[Reply to Linker error caused by Qt qjpeg4 on Thu, 25 Jul 2013 08:22:45 GMT]]></title><description><![CDATA[<p dir="auto">Please remove all the jpg-plugin related code from your source file and pro file.</p>
<p dir="auto">It's a plugin, and it will be automatically load by your application.</p>
]]></description><link>https://forum.qt.io/post/187742</link><guid isPermaLink="true">https://forum.qt.io/post/187742</guid><dc:creator><![CDATA[dbzhang800]]></dc:creator><pubDate>Thu, 25 Jul 2013 08:22:45 GMT</pubDate></item></channel></rss>