mac下安装mysqldb时出现的问题

在mac环境下安装mysqldb时遇到编译错误,提示'cc'命令失败退出状态1。问题根源可能是gcc版本不兼容。通过搜索解决方案,发现无需卸载xcode和command-line-tools,而是通过设置环境变量CFLAGS和CPPFLAGS为-Qunused-arguments来将错误警告转化为警告,从而成功解决这个问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. 
building 'Crypto.Hash._MD2' extension 
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.9-intel-2.7/src/MD2.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 


网上说是gcc版本不兼容的的问题

百度一下很多人将卸载xcode和commond-line-tools,但是这样太麻烦了 而且不知道怎么卸载

再百度得知

clang并不支持这个参数, 做一下修改把他改成warning. 

export CFLAGS=-Qunused-arguments 
export CPPFLAGS=-Qunused-arguments 

这样就ok了.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值