首頁  >  問答  >  主體

linux - OS X编译bochs报错 [configure: error: C compiler cannot create executables]

根据这个链接做安装前的配置

sh .conf.macosx后出现以下信息
根据google到的信息,缺少command line tools,已经执行xcode-select --install并完成安装。

gcc版本不对? 缺乏库?

checking build system type... x86_64-apple-darwin13.1.0
checking host system type... x86_64-apple-darwin13.1.0
checking target system type... x86_64-apple-darwin13.1.0
checking if you are configuring for another platform... no
checking for standard CFLAGS on this platform... -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/myName/Desktop/bochs-2.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

不知如何提取config.log的有效信息,直接将文件挂在这里了

阿神阿神2743 天前926

全部回覆(4)我來回復

  • 阿神

    阿神2017-04-17 11:45:45

    試試這個:
    CFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" ./configure ...
    如果還是不行就試試:
    CC='clang -Wno-error=unused-command-line-argument-hard-error-in-future' ./configure ...

    不過話說回來,如果你要裝bochs,最好用Homebrew,裝好這個之後用brew install bochs就行了。

    回覆
    0
  • 黄舟

    黄舟2017-04-17 11:45:45

    我覺得是缺少一些以來庫,但我無法給出具體是哪些東西。
    根據檢索,可以先嘗試安裝:
    brew install sdl
    然後記得在你的編譯目錄裡運行:
    make distclean
    再重新編譯安裝。

    回覆
    0
  • 怪我咯

    怪我咯2017-04-17 11:45:45

    configure:3691: checking whether the C compiler works
    configure:3713: gcc -arch i386 -m32 -pipe -O3 -I/sw/include -fomit-frame-pointer -finline-functions -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 -fprefetch-loop-arrays  -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh  -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh -arch i386 -m32 -L/sw/lib conftest.c  >&5
    clang: error: unknown argument: '-falign-loops=16' [-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
    clang: error: unknown argument: '-falign-jumps=16' [-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
    clang: error: unknown argument: '-falign-labels=16' [-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
    clang: error: unknown argument: '-falign-loops-max-skip=15' [-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
    clang: error: unknown argument: '-falign-jumps-max-skip=15' [-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
    configure:3717: $? = 1
    configure:3755: result: no
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME ""
    | #define PACKAGE_TARNAME ""
    | #define PACKAGE_VERSION ""
    | #define PACKAGE_STRING ""
    | #define PACKAGE_BUGREPORT ""
    | #define PACKAGE_URL ""
    | /* end confdefs.h.  */
    | 
    | int
    | main ()
    | {
    | 
    |   ;
    |   return 0;
    | }
    configure:3760: error: in `/Users/rahn/Desktop/bochs-2.6':
    configure:3762: error: C compiler cannot create executables
    

    你的 gcc 其實是 clang。 configure 腳本給了一個它不支援的參數過去。可能是版本的問題。你可以試試 CFLAGS='-Wunused-command-line-argument-hard-error-in-future' ./configure

    或把 CC 設定成 clang 試試?

    回覆
    0
  • PHPz

    PHPz2017-04-17 11:45:45

    brew安裝gcc,設定環境變數CC為gcc試試。 brew有多個gcc的版本可以選擇,4.8,4.7,選擇一個好了,如果還出錯,繼續貼log吧

    回覆
    0
  • 取消回覆