最近升级了 Mac osX 到 10.15.7, 顺便更新了最新的xcode,更新到xcode12, 所有都升级完,也编译了项目,能正常运行,打包也没问题。昨天Qt 代码有修改,顺便从项目git仓库更新项目Qt部分代码,编译Qt代码,出现了很久没有出现的问题:fatal error: 'string.h' file not found, 这个问题之前升级 xcode 或者升级 Mac osX 有出现过类似的问题,按照之前的经验,把编译目录删除重新编译就可以,这次也照样做,结果qmake都过不了,报错了:

Project ERROR: Cannot run target compiler '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++'. Output:
===================
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/c++/v1""/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-ios14.0.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=14.0 -target-cpu core2 -dwarf-column-info -debugger-tuning=lldb -target-linker-version 609 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -fdeprecated-macro -fdebug-compilation-dir /Users/derom/Applications/Qt/5.15.1/ios/mkspecs/features -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=ios-14.0.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o /var/folders/fb/wln8b4nd5sx2vl2bx3gjqng00000gn/T/--211cc3.o -x c++ -
clang -cc1 version 12.0.0 (clang-1200.0.32.2) default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory
11cc3.o -x c++ -
clang -cc1 version 12.0.0 (clang-1200.0.32.2) default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks (framework directory)
End of search list."/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -dylib -arch x86_64 -platform_version ios 14.0.0 14.0 -single_module -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -o /dev/null -v /var/folders/fb/wln8b4nd5sx2vl2bx3gjqng00000gn/T/--211cc3.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/lib/darwin/libclang_rt.ios.a
@(#)PROGRAM:ld  PROJECT:ld64-609
BUILD 07:59:13 Aug 25 2020
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/lib
Framework search paths:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/lib/libc++.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/lib/libc++.tbd (4 slices)
ld: building for iOS, but linking in object file built for iOS Simulator, file '/var/folders/fb/wln8b4nd5sx2vl2bx3gjqng00000gn/T/--211cc3.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
===================
Maybe you forgot to setup the environment?

这可怎么办,开始还是编译出问题,现在都不能qmake了,彻底绝望,只能重装xcode,重装Qt,疯狂折腾,一上午过去了, 又是百度,又是google,关键是google突然不用,世界突然安静了!只能好好念佛了,心里默念阿弥陀佛!先是重装Qt,还是qmake报错,没办法删除了xcode,准备xcode退回xcode11, xcode11也有7.5G,很大,只能慢慢等,下午也三四点了,又在我的黑苹果上尝试google,突然能访问了(一直 chrome google 助手),如是又google搜索,原来早就有国际友人在用Qt + xcode12,当然是用不了,一样qmake出错,在Qt bug 系统请求帮助,问题严重,Qt大佬是第一时间出现,给也解决方案,修改 mkspecs/features/toolchain.prf 文件

--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -199,7 +199,7 @@ isEmpty($${target_prefix}.INCDIRS) {cxx_flags += -E -voutput = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
-        !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output)
+        !uikit:!equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output)rim_qcc {for (line, output) {

加个 “!uikit:”搞定,可以了,具体问题查看Qt bug 系统

qmake cannot run target compiler for iOS Xcode 12(https://bugreports.qt.io/browse/QTBUG-86718)

我只是搬运工,主要是方便国内不能google 同学们,百度确实找不到解决方案!阿弥陀佛!

Qt 遇到 xcode12 编译报错 ‘string.h‘ file not found相关推荐

  1. Xcode12编译报错 “building for iOS,but linking in object file built for iOS Simulator”

    Xcode12编译报错 "building for iOS,but linking in object file built for iOS Simulator" cocoapod ...

  2. Qt开发,编译报错:Cannot find file: xxx.pro.

    一.问题描述 Qt开发,编译报错:Cannot find file: xxx.pro. 二.问题分析 工程目录包含中文目录 三.解决方案 将工程放于不含中文目录的文件夹下

  3. CMAKE编译报错 linker input file unused because linking not done

    CMakeLists编译报错linker input file not found 解决办法:add_compile_options(-std=c++11 -o) 删掉 -o 原始CMakeLists ...

  4. ubuntu 找不到mysql.h_ubuntu安装了mysql 但是编译报错 mysql.h: No such file or directory

    在Ubuntu体系中,已经安装了mysql,即应用sudo apt-get install mysql-server mysql-client 但是用C编译mysql数据库时,报错 fatal err ...

  5. 【错误记录】Windows 控制台程序编译报错 ( WINDOWS.H already included. MFC apps must not #include <Windows.h> )

    文章目录 一.报错信息 二.解决方案 一.报错信息 Windows 控制台程序编译报错 : 已启动生成- 1>------ 已启动生成: 项目: hacktool, 配置: Debug Win3 ...

  6. 关于 mac m1 xcode12 编译报错 this target. for architecture arm64等问题解决方案

    最近换了 mac m1 开发,xcode12在运行旧项目报错 的问题 xxxx building for iOS Simulator, but linking in object file built ...

  7. 关于 m1 xcode12 编译报错 this target. for architecture arm64等问题解决方案

    最近换了 mac m1 开发,xcode12在运行旧项目报错 的问题 xxxx building for iOS Simulator, but linking in object file built ...

  8. [Elasticsearch] es 6.8 编译报错 Unsupported class file major version 57

    1.概述 Mac 编译es 6.8 报错 Caused by: java.lang.IllegalArgumentException: Unsupported class file major ver ...

  9. sudo pip install -i https://pypi.douban.com/simple --user MySQL-python报错‘my_config.h‘ file not found

    异常: Google了无数次,都没用 后面无意之间看到了一篇博客 https://www.codenong.com/cs107125972/ 按照他的方式改了,但是没有用 仔细检查异常报错后: 到了c ...

最新文章

  1. Linux下Tomcat多部署形式,让每个项目维护起来互不影响
  2. lwip协议栈中超时定时器实现原理
  3. Java多线程 - 线程组
  4. 树莓派进阶之路 (016) - 通过595驱动4位LED显示系统时间
  5. Flash如何为文字描边
  6. python阈值计算_python – 在numpy中计算超过阈值的数组值的最快方法
  7. 12-文本属性和字体属性
  8. 向来只用联发科、三星处理器的魅族,怎么就被高通控告了?
  9. 无法Debug SQL: Unable to start T-SQL Debugging. Could not attach to SQL Server process on
  10. fp16和fp32,神经网络混合精度训练,PYTORCH 采用FP16,Libtorch采用FP16,神经网络混合精度三种避免损失,TensorRT模型转换及部署(一)
  11. 排名 教材 数字电子技术_数字电子技术教材改革及实践
  12. LeetCode contest 182 5369. 统计作战单位数
  13. 计算机考试界面没有验证码,win10系统下网页验证码显示不了的两种解决方法
  14. Matlab R2017b 自动驾驶工具箱学习笔记(3)_Tutorials_Forward Collision Warning Using Sensor Fusion
  15. java forward怎么用_【后端开发】java中forward是什么
  16. 各国语言缩写-各国语言简称
  17. 华为OD机试 - 按身高和体重排队(Java JS Python)
  18. 苹果cmsV10程序无法搜索影片的处理教程
  19. vue-video-play使用方法
  20. 磁共振图像处理流程,基于北师大DPARSF

热门文章

  1. HotSpot汇编器与模板解释器
  2. 微信小程序:选择从本地相册选择图片或使用相机拍照
  3. 爬虫快速入门教程:爬虫应该怎么学
  4. 全景图(二):在Unity3D上实现360°柱面投影
  5. 多进程、多线程的适用场景
  6. WinHTTP中的HINTERNET句柄
  7. 商贸企业的库存管理应该怎么管?
  8. Java如何转换图片的格式?
  9. 【windows7】笔记本电脑没声音了怎么办
  10. Obsidian插件推荐和页面宽度行间距设置