clang: error: unknown argument: '-mno-fused-madd'

环境os10.9.2     xcode5.1

1. pip install reportlab一直报错:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel/_rl_accel.c -o build/temp.macosx-10.9-intel-2.7/private/tmp/pip_build_root/reportlab/src/rl_addons/rl_accel/_rl_accel.o


clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]


clang: note: this will be a hard error (cannot be downgraded to a warning) in the future


error: command 'cc' failed with exit status 1


----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/reportlab/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-e7bQve-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/reportlab

Storing debug log for failure in /Users/haohuiyan/Library/Logs/pip.log


2. 咨询了一下说是换32位的python,换了之后还是这个问题


3. 找到这个http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa/22315129#22315129


4. 我的解决方案是:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

sudo -E pip install reportlab


收获:就是管他三七二十一,当时是准备把贴子里面的方案全部试一遍,大不了重新装系统

### Clang 编译器在 Qt Creator 中遇到 `-style=file` 未知参数问题的原因分析 当使用 Clang 工具链作为代码格式化工具时,如果配置不正确或者版本兼容性存在问题,则可能会触发 `unknown argument '-style=file'` 的错误提示。此问题是由于 Clang 格式化工具未能识别该特定选项所引起的。 #### 原因解析 Clang-format 使用 `-style=file` 参数来指示程序读取 `.clang-format` 文件中的样式设置[^1]。然而,在某些情况下,可能是因为安装的 Clang 版本较旧而不支持这一功能,或者是环境变量未正确定义导致无法找到对应的文件路径。 以下是解决问题的具体方法: --- ### 解决方案一:更新 Clang 到最新稳定版 确认当前使用的 Clang 是否为最新的稳定版本。可以通过以下命令检查已安装的 Clang 版本号: ```bash clang --version ``` 如果发现版本过低(低于8.x),建议升级到更高版本以获得更好的兼容性和特性支持。例如通过包管理器或官方源码重新构建并替换现有二进制文件[^2]。 --- ### 解决方案二:手动指定风格文件位置 尝试修改调用方式,显式提供完整的路径指向 .clang-format 配置文件而不是依赖默认行为寻找它。具体做法是在项目根目录下创建名为`.clang-format` 的文本档,并调整IDE内部设定让其知晓确切地址而非单纯依靠相对寻址机制完成加载过程[^3]: 进入 **QtCreator -> Tools -> Options...**, 找到 C++ 节点下的 Code Style 子项卡页, 将 Automatic Formatting 下拉菜单切换至 Custom ,接着填入如下内容代替原有的简单标记形式: ```plaintext -style=file://<absolute-path-to-your-project-root>/.clang-format ``` 注意这里需替换成实际存在的绝对物理磁盘上的全限定名字符串表达。 --- ### 解决方案三:禁用有问题的功能模块 对于那些暂时不需要利用自动美化服务的情况来说,可以直接关闭相关联接开关从而规避掉潜在冲突风险。即前往上述提到过的同一界面区域取消勾选 Enable code formatting 功能按钮即可快速脱离困境而无需深入探究根本成因所在之处[^4]. --- ### 示例代码片段展示如何验证配置生效与否 下面给出一段简单的测试脚本来帮助开发者判断当前环境中是否存在相同类型的异常状况发生: ```cpp #include <iostream> int main() { std::cout << "Testing clang format integration..." << std::endl; int a =0 ;// Intentionally bad spacing to test formatter. return (a == 0)? EXIT_SUCCESS :EXIT_FAILURE ; } ``` 运行以上样例前记得先保存好原始状态副本以防万一造成不可逆更改后再对比前后差异效果便能直观看出是否有改善迹象呈现出来. ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值