安装xcode 5,gcc4.8(带有自制程序)和xcode命令行工具后,ide会尝试使用/usr/local/bin/gcc-4.8并使用退出代码1失败,即使在构建选项中也是如此选择了“默认编译器(Apple LLVM 5.0)”。 请帮忙。
答案 0 :(得分:0)
在mi Lion上自制的构建失败,但我用这个配置构建了apple llvm-gcc42:
成功gmp:
CFLAGS="-m32 -m64" CPPFLAGS="-m32 -m64" CXXFLAGS="-m32 -m64" LFLAGS="-m32 -m64" LDFLAGS="-m32 -m64" ./configure --prefix=/usr/local --enable-cxx --build=x86_64-apple-darwin --host=none-apple-darwin --enable-fat=yes
成功mpfr:
CFLAGS="-m32 -m64" CPPFLAGS="-m32 -m64" CXXFLAGS="-m32 -m64" LFLAGS="-m32 -m64" LDFLAGS="-m32 -m64" ./configure --prefix=/usr/local --build=x86_64-apple-darwin --host=none-apple-darwin
成功mpc:
CFLAGS="-m32 -m64" CPPFLAGS="-m32 -m64" CXXFLAGS="-m32 -m64" LFLAGS="-m32 -m64" LDFLAGS="-m32 -m64" ./configure --prefix=/usr/local --build=x86_64-apple-darwin --host=none-apple-darwin
成功是:
CFLAGS="-m32 -m64" CPPFLAGS="-m32 -m64" CXXFLAGS="-m32 -m64" LFLAGS="-m32 -m64" LDFLAGS="-m32 -m64" ./configure --prefix=/usr/local --build=x86_64-apple-darwin --host=none-apple-darwin --enable-portable-binary
成功的斗篷:
CFLAGS="-m32 -m64" CPPFLAGS="-m32 -m64" CXXFLAGS="-m32 -m64" LFLAGS="-m32 -m64 -L/usr/local/lib" LDFLAGS="-m32 -m64 -L/usr/local/lib" ./configure --prefix=/usr/local --build=x86_64-apple-darwin --host=none-apple-darwin --enable-portable-binary --with-isl-prefix=/usr/local
成功gcc 4.8.1:
./configure --prefix=/usr/local --enable-languages=c,c++,objc,obj-c++ --build=x86_64-apple-darwin --target=x86_64-apple-darwin --with-system-zlib --enable-multilib --enable-objc-gc --enable-lto --enable-ld=yes --enable-bootstrap --enable-gold=yes CC="/usr/bin/gcc" CXX="/usr/bin/g++" CFLAGS="-mmacosx-version-min=10.5" CXXFLAGS="-mmacosx-version-min=10.5" CPPFLAGS="-mmacosx-version-min=10.5" OBJCFLAGS="-mmacosx-version-min=10.5" OBJCXXFLAGS="-mmacosx-version-min=10.5" LFLAGS="-mmacosx-version-min=10.5" LDFLAGS="-mmacosx-version-min=10.5"
您需要下载所有资源,不要使用任何macports和brew。
Ypu可以使用来自http://chomikuj.pl/ydk2/wxwidgets+Mac+OS+X/wxphp/main.wxphp.app.bundle.10.6.i386,3523603473.zip的gcc-4.8.1来检查构建程序。这只是我的测试构建,但在L和ML上进行了检查。
编辑... 然后你可以尝试添加〜/ .profile:
alias gcc=/usr/local/bin/gcc
alias cc=/usr/local/bin/gcc
alias g++=/usr/local/bin/g++
alias c++=/usr/local/bin/c++
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
export PATH=/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:$PATH
只有在那里有二进制文件时,/ opt / bin才是可选的。 但首先需要在/ usr / local / bin中安装gcc,如果首先添加/ usr / bin,/ usr / bin / gcc用于命令gcc
对于Apple gcc simple in shell:
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
export CPP=/usr/bin/cpp
export LD=/usr/bin/ld
alias c++=/usr/bin/c++
alias g++=/usr/bin/g++
alias gcc=/usr/bin/gcc
alias cpp=/usr/bin/cpp
alias cc=/usr/bin/cc