<?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[&quot;unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked)&quot;  (Qt6, Mac)]]></title><description><![CDATA[<p dir="auto">I am converting a project from Qt5 to Qt6.11 on the Mac.<br />
My .PRO file specifies:</p>
<pre><code>QT += core gui help uitools  widgets printsupport network xml sql

Platforms.files += $$(QTDIR)/plugins/platforms/libqcocoa.dylib
Styles.files += $$(QTDIR)/plugins/styles/libqmacstyle.dylib
Imageformats.files += $$(QTDIR)/plugins/imageformats/libqico.dylib \
	$$(QTDIR)/plugins/imageformats/libqgif.dylib \
	$$(QTDIR)/plugins/imageformats/libqjpeg.dylib \
	$$(QTDIR)/plugins/imageformats/libqsvg.dylib
</code></pre>
<p dir="auto">QTDIR resolves to:</p>
<pre><code>/Users/me/Qt6/6.11.1/macos
</code></pre>
<p dir="auto">I am getting the errors:</p>
<pre><code>unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/platforms/libqcocoa.dylib'
unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/imageformats/libqico.dylib'
unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/styles/libqmacstyle.dylib'
unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/imageformats/libqgif.dylib'
unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/imageformats/libqjpeg.dylib'
unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/imageformats/libqsvg.dylib'
unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '../MyApp.app/Contents/Plugins/sqldrivers/libqsqlite.dylib'
</code></pre>
<p dir="auto">Why is Qt objecting to its own DLLs? I delete the MyApp.app folder before compiling. It is built during the compilation step, presumably the .dylib's are drawn from QTDIR?</p>
<p dir="auto">Can you help get this thing to link?</p>
]]></description><link>https://forum.qt.io/topic/164745/unsupported-mach-o-filetype-only-mh_object-and-mh_dylib-can-be-linked-qt6-mac</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 21:02:03 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164745.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Jun 2026 16:06:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked)&quot;  (Qt6, Mac) on Thu, 04 Jun 2026 19:16:14 GMT]]></title><description><![CDATA[<p dir="auto">The thing is (even if it somehow worked before): you don't link dynamic plugins. They are loaded at run time but are not linked into your binary.</p>
<p dir="auto">I can totally relate to not doing a build system migration at the same time as a gazillion other things more pressing.</p>
]]></description><link>https://forum.qt.io/post/838593</link><guid isPermaLink="true">https://forum.qt.io/post/838593</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 04 Jun 2026 19:16:14 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked)&quot;  (Qt6, Mac) on Thu, 04 Jun 2026 18:56:06 GMT]]></title><description><![CDATA[<p dir="auto">I asked ChatGPT and the solution was to remove the following lines from the .PRO file:</p>
<pre><code>PrintSupport.files += $$(QTDIR)/plugins/printsupport/libcocoaprintersupport.dylib
PrintSupport.path = Contents/Plugins/printsupport
Platforms.path = Contents/Plugins/platforms
Platforms.files += $$(QTDIR)/plugins/platforms/libqcocoa.dylib
Styles.path = Contents/Plugins/styles
Styles.files += $$(QTDIR)/plugins/styles/libqmacstyle.dylib
Imageformats.path = Contents/Plugins/imageformats

-L"MyApp.app/Contents/Plugins/platforms" -lqcocoa \
</code></pre>
<p dir="auto">CharGPT warned me that:<br />
"Under Qt6 on macOS, the plugin binaries are no longer ordinary .dylib files"<br />
"let Qt deploy the plugins."<br />
"Your linker is explicitly trying to link the plugins into the executable."</p>
<p dir="auto">My experience is primarily Windows, I don't know much about macOS.</p>
<p dir="auto">I would dearly love to migrate to CMake. I even started doing it, using a utility to convert the .PRO to CMakeLists.txt. But the errors I am getting are incomprehensible. I've got so many irons in the fire, I just have to put this on the back burner until I can devote all the time it's going to require to deal with it.</p>
]]></description><link>https://forum.qt.io/post/838587</link><guid isPermaLink="true">https://forum.qt.io/post/838587</guid><dc:creator><![CDATA[Sprezzatura]]></dc:creator><pubDate>Thu, 04 Jun 2026 18:56:06 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked)&quot;  (Qt6, Mac) on Wed, 03 Jun 2026 18:39:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">What is done with these <code>.pro</code> file variables you create ?</p>
<p dir="auto">On a side note, did you consider moving to cmake as well ? qmake is deprecated (but still supported).</p>
]]></description><link>https://forum.qt.io/post/838565</link><guid isPermaLink="true">https://forum.qt.io/post/838565</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 03 Jun 2026 18:39:13 GMT</pubDate></item></channel></rss>