坚持QtQML,坚持移动互联网

http://www.qtcn.org/bbs/u/121778  [收藏] [复制]

toby520

将QtCoding进行到底,做Qt的宠儿

  • 89

    关注

  • 164

    粉丝

  • 3579

    访客

  • 等级:精灵王
  • 身份:论坛版主
  • 总积分:1262
  • 男,1986-11-17

最后登录:2024-04-29

更多资料

日志

高版本xcode编译qt项目出现启动程序出错的解决方案

2024-01-10 17:19


Solving problems using Qt with Xcode 15

Published on October 4, 2023 by CrystalIDEA

Once you upgrade to macOS Sonoma, you have to use Xcode 15 (Xcode 14 won’t work) and might face similar problems as described below.

Problem #1: QMake does not work with Xcode 15


When trying to build a project on macOS you get the following error:

failed to parse default search paths from compiler output
Solution: this has been fixed in Qt 6.5.3 (will be also fixed in Qt 5.15.16 commercial), for earlier Qt version you should apply the following patch to mkspecs/features/toolchain.prf file before compiling. It can be easily backported to Qt 5.15.x - example.

Problem #2: your Qt app crashes when running on macOS < 14 (and iOS < 17)


Crash report will have something like this:

dyld[56529]: Symbol not found: __ZTVNSt3__13pmr15memory_resourceEReferenced from: <UUID> qt6/qtbase/build_arm64/libexec/mocExpected in:     <UUID> /usr/lib/libc++.1.dylib
Solution: this has been fixed in Qt 6.5.3 (will be also fixed in Qt 5.15.16 commercial), for earlier Qt version you should apply the following patch to some headers before compiling. It can be easily backported to Qt 5.15.x - example.

Problem #3: your Qt app crashes when running on macOS < 13 (and iOS < 15)


Crash reports might look different, our report on macOS 11:

Crashed Thread:        0  mainThread  Dispatch queue: com.apple.main-threadException Type:        EXC_BAD_ACCESS (SIGSEGV)Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000008cfe004Exception Note:        EXC_CORPSE_NOTIFYTermination Signal:    Segmentation fault: 11Termination Reason:    Namespace SIGNAL, Code 0xbTerminating Process:   exc handler [1068]Thread 0 Crashed:: mainThread  Dispatch queue: com.apple.main-thread0   org.qt-project.QtCore           0x0000000109e5a4a9 operator==(QString const&, QString const&) + 91   org.qt-project.QtCore           0x0000000109faafd0 QObject::setObjectName(QString const&) + 1122   com.crystalidea.anytoiso        0x0000000108d0c513 0x108cfe000 + 586433   com.crystalidea.anytoiso        0x0000000108d0c128 QAppMainWindow::QAppMainWindow(QWidget*, QFlags<Qt::WindowType>) + 884   com.crystalidea.anytoiso        0x0000000108d0ac79 main + 1535   libdyld.dylib                   0x00007fff20480f3d start + 1
It’s caused by the new optimized Xcode 15 linker when linking static libraries.

Binaries using symbols with a weak definition crash at runtime on iOS 14/macOS 12 or older. This impacts primarily C++ projects due to their extensive use of weak symbols. (114813650) (FB13097713)

Xcode release notes with detailed explanation
Solution: add this to your .pro file
LIBS += -Wl,-ld_classic


https://crystalidea.com/blog/qt-apps-crash-when-using-xcode-15


分类:Mac OS X|回复:0|浏览:152|全站可见|转载
 

下一篇:

上一篇: Cronet 网络库相关资料

Powered by phpwind v8.7 Certificate Copyright Time now is:04-29 22:21
©2005-2016 QTCN开发网 版权所有 Gzip disabled