如何通过修复`apxs:错误:命令失败并使用rc = 65536`来编译Mountain Lion(Mavericks)上的mod_wsgi,mod_fastcgi等?
作者:互联网
我已经更新到OS X Mountain Lion了.
Update已经删除了我的所有python和apache模块,包括mod_wsgi.
现在我正在尝试重新编译mod_wsgi(它在Lion上编译没有问题).
我使用的源代码来自:http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2
./configure创建Makefile没有问题:
$./configure
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.22
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile
但是返回错误:
$make
/usr/sbin/apxs -c -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE -Wc,'-arch x86_64' mod_wsgi.c -Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error /System/Library/Frameworks/ -arch x86_64 -ldl -framework CoreFoundation
/usr/share/apr-1/build-1/libtool --silent --mode=compile /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/local/include -I/usr/include/apache2 -I/usr/include/apr-1 -I/usr/include/apr-1 -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
env: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc: No such file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
解决方法:
我在撰写问题时解决了这个问题:
出于某种原因/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/文件夹(包含Xcode命令行工具)在这里:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
解决问题:
$sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
Greg Bair对小牛队的建议:
$sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
这会在右侧文件夹中创建符号链接.
标签:python,xcode,gcc,mountain-lion,mavericks 来源: https://codeday.me/bug/20190817/1674462.html