【问题标题】:Xcode gcc exit status 1Xcode gcc 退出状态 1
【发布时间】:2010-12-22 09:43:19
【问题描述】:

首先,我对这一切都很陌生。
我最近升级到 Snow Leopard 并安装了 Xcode + iPhone 开发包 3.1.2。 我继续安装 Django 框架 + MYSQLDB 处理程序。在构建阶段,终端向我显示 gcc 退出状态 1 错误。但是我已经安装了 Xcode?​​p>

我哪里错了?

另外,在尝试解决问题时,我安装了 Snow Leopard DVD 附带的 Xcode。还是一样的错误。

现在我认为我应该完全删除 Xcode 并重新安装?

ver.3.1.2 是特定于 32 位的吗?请帮帮我。

这是完整的错误:

Amit-Vermas-MacBook:mysql-python-1.2.2 amitverma$ gcc-4.0
i686-apple-darwin10-gcc-4.0.1: no input files
Amit-Vermas-MacBook:mysql-python-1.2.2 amitverma$ python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-i386-2.5/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
cc1: error: unrecognized command line option "-Wno-long-double"
error: command 'gcc' failed with exit status 1

【问题讨论】:

    标签: python xcode macos gcc mysql


    【解决方案1】:

    如果有帮助,我用符号链接解决了这个问题,我认为它对你有用。我写这篇文章时考虑到了我的 gcc 版本,即 4.2:

    cd /usr/bin
    rm cc gcc c++ g++
    ln -s gcc-4.2 cc
    ln -s gcc-4.2 gcc
    ln -s c++-4.2 c++
    ln -s g++-4.2 g++
    ln -s gcc-4.2 gcc-4.0
    

    你去!

    【讨论】:

      【解决方案2】:

      我不确定你是否解决了你的问题。从 Mac OS 10.4 升级到 10.6 后,我遇到了完全相同的问题。

      在阅读了一些博客文章之后,我预感地运行了 setup.py 指向一个较旧的 gcc 版本 (gcc-4.0)。

      CC='/usr/bin/gcc-4.0' python setup.py build

      构建遇到了一些警告。

      running build
      running build_py
      copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
      running build_ext
      building '_mysql' extension
      /usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-i386-2.5/_mysql.o -g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
      In file included from _mysql.c:36:
      /usr/local/mysql/include/my_config.h:1050:1: warning: "HAVE_WCSCOLL" redefined
      In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
                       from pymemcompat.h:10,
                       from _mysql.c:29:
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:724:1: warning: this is the location of the previous definition
      gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.3-i386-2.5/_mysql.so
      ld: warning: in build/temp.macosx-10.3-i386-2.5/_mysql.o, file is not of required architecture
      ld: warning: in /usr/local/mysql/lib/libmysqlclient_r.dylib, file is not of required architecture
      ld: warning: in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture
      

      再次运行相同的命令。

      现在一切都很神奇。安装也通过了。该模块按预期工作。

      【讨论】:

        【解决方案3】:

        它通常还显示为什么编译失败。你能给出“gcc exited with code 1”之前的文字或类似的东西吗?也许还有源文件。

        还可以查找有关此主题的其他线程,例如 this one。 google 或 stackoverflow 上的好搜索词是 leopard 和 MySQLdb。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2022-12-03
          • 1970-01-01
          • 2020-04-16
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多