<?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[My app crashes because libc++ is missing.]]></title><description><![CDATA[<p dir="auto">This is under Mac OS. We have an all-CMake-based project.</p>
<p dir="auto">If I build my app through Qt Creator, it runs fine. If I build it via a script that calls CMake, it crashes on launch with</p>
<pre><code>Dyld Error Message:
  dyld: Using shared cache: 1D800E79-F93F-3FEF-9658-B168A649E2E4
Library not loaded: @rpath/libc++abi.1.dylib
  Referenced from: /Volumes/Cast/Cast.app/Contents/Frameworks/libc++.1.dylib
  Reason: image not found
</code></pre>
<p dir="auto">Looking in the application bundle, I see that the one built by script contains a ton of frameworks under Frameworks, including libc++.1.dylib. The one built by Qt Creator contains none; thus I conclude that Qt Creator is building a statically-linked app and the script is building a dynamic one.</p>
<p dir="auto">Obviously this raises some questions. First, why the difference in linkage? The script does this:</p>
<pre><code>/Applications/CMake.app/Contents/bin/cmake -S $1 -B $BUILD_DIR -GNinja -DCMAKE_BUILD_TYPE:String=${BUILD_TARGET} -DQT_QMAKE_EXECUTABLE:STRING=$QT_DIR/bin/qmake -DCMAKE_PREFIX_PATH:STRING=$QT_DIR -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_CXX_COMPILER:STRING=/usr/bin/clang++ -DCMAKE_MAKE_PROGRAM:STRING=$QT_ROOT_DIR/Tools/Ninja/ninja
</code></pre>
<p dir="auto">Looking at the project settings in Qt Creator, I don't see where it specifies static vs. dynamic. I don't see it in the CMakeLists files either; that wouldn't explain why the two builds would vary anyway.</p>
<p dir="auto">Also, why is libc++abi.1.dylib missing, when libc++.1.dylib isn't? On my system, these are found under Homebrew's control in usr/local/opt/lib. I have no idea how anything finds them, since there are no symlinks to them under /usr/lib or /usr/local/lib. But I guess that's academic, because they are being found or sourced from elsewhere.</p>
<p dir="auto">Thanks for any suggestions on tracking this down!</p>
]]></description><link>https://forum.qt.io/topic/134734/my-app-crashes-because-libc-is-missing</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 10:40:14 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/134734.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Mar 2022 18:50:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Wed, 02 Mar 2022 20:51:54 GMT]]></title><description><![CDATA[<p dir="auto">In the build panel.</p>
]]></description><link>https://forum.qt.io/post/704895</link><guid isPermaLink="true">https://forum.qt.io/post/704895</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 02 Mar 2022 20:51:54 GMT</pubDate></item><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Tue, 01 Mar 2022 21:20:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> Thanks.</p>
<p dir="auto">Is there a way to see the commands that are issued when you select "Run CMake" in Qt Creator? I tried pasting the contents of the "initial CMake parameters" into a call to cmake in a script, but I get</p>
<pre><code>CMake Error at lib/lib_camera_match/src/CMakeLists.txt:3 (project):
  project could not find requested file:

    %{IDE:ResourcePath}/package-manager/auto-setup.cmake
</code></pre>
<p dir="auto">This is followed by tons of warnings like</p>
<pre><code>ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.
</code></pre>
]]></description><link>https://forum.qt.io/post/704706</link><guid isPermaLink="true">https://forum.qt.io/post/704706</guid><dc:creator><![CDATA[Stokestack]]></dc:creator><pubDate>Tue, 01 Mar 2022 21:20:54 GMT</pubDate></item><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Tue, 01 Mar 2022 20:59:30 GMT]]></title><description><![CDATA[<p dir="auto">If memory serves well, it's related to implicit system libs or something like that.</p>
<p dir="auto">As for building with Qt Creator, it usually configures the build by pointing to the Qt version of your kit. You can find informations in the CMakefiles.txt.user file. Using ccmake in the build folder should also give you hints.</p>
]]></description><link>https://forum.qt.io/post/704703</link><guid isPermaLink="true">https://forum.qt.io/post/704703</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 01 Mar 2022 20:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Tue, 01 Mar 2022 20:54:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> My question is regarding the otool output for the <strong>non-script-built</strong> application, the one built by Qt Creator, which runs. It claims that it's linked against</p>
<p dir="auto">/usr/lib/libc++.1.dylib</p>
<p dir="auto">This file does not exist on my system. So how can it be linked against?</p>
<p dir="auto">As a solution to the overall problem, how can I capture the build commands used by Qt Creator so I can use them in place of whatever the script is doing?</p>
<p dir="auto">I've tried (BUILD_DIR is passed into the script as a command-line parameter):</p>
<pre><code>cmake --build $BUILD_DIR --target all
</code></pre>
<p dir="auto">but the result is "Error: could not load cache." In the project build settings I see "Initial CMake parameters," but I don't know how to incorporate those into a scripted invocation.</p>
]]></description><link>https://forum.qt.io/post/704701</link><guid isPermaLink="true">https://forum.qt.io/post/704701</guid><dc:creator><![CDATA[Stokestack]]></dc:creator><pubDate>Tue, 01 Mar 2022 20:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Tue, 01 Mar 2022 20:44:19 GMT]]></title><description><![CDATA[<p dir="auto">As I wrote, I don't know what your script does and I suspect there lies the issue.</p>
]]></description><link>https://forum.qt.io/post/704699</link><guid isPermaLink="true">https://forum.qt.io/post/704699</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 01 Mar 2022 20:44:19 GMT</pubDate></item><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Tue, 01 Mar 2022 20:37:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> Thanks for that info.</p>
<p dir="auto">otool -L on the app that runs shows:</p>
<pre><code>/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
</code></pre>
<p dir="auto">But why, when that file does not exist?<br />
The app that crashes shows:</p>
<pre><code>@executable_path/../Frameworks/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
</code></pre>
<p dir="auto">Every other lib appears to be the same between the two versions, typically</p>
<pre><code>@rpath/QtQuickControls2.framework/Versions/5/QtQuickControls2 (compatibility version 5.15.0, current version 5.15.2)
</code></pre>
]]></description><link>https://forum.qt.io/post/704698</link><guid isPermaLink="true">https://forum.qt.io/post/704698</guid><dc:creator><![CDATA[Stokestack]]></dc:creator><pubDate>Tue, 01 Mar 2022 20:37:19 GMT</pubDate></item><item><title><![CDATA[Reply to My app crashes because libc++ is missing. on Tue, 01 Mar 2022 19:52:45 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">No, Qt Creator does not create static binaries like that. You would need a static version of Qt and all of the dependencies. Standard library like the C++ runtime is provided by the system.</p>
<p dir="auto">You can use for example otool to see exactly what is linked to your executable.</p>
<p dir="auto">Your script is likely doing something fishy.</p>
]]></description><link>https://forum.qt.io/post/704690</link><guid isPermaLink="true">https://forum.qt.io/post/704690</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 01 Mar 2022 19:52:45 GMT</pubDate></item></channel></rss>