質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
GCC

GCCはGNU Compiler Collectionの略です。LinuxのC言語コンパイラのデファクトスタンダードであり、数多くの他言語やプラットフォームサポートもします。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Q&A

解決済

1回答

6077閲覧

configureでエラーが生じる

ToshiyukiAraki

総合スコア18

GCC

GCCはGNU Compiler Collectionの略です。LinuxのC言語コンパイラのデファクトスタンダードであり、数多くの他言語やプラットフォームサポートもします。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

0グッド

0クリップ

投稿2019/12/01 06:24

編集2019/12/01 06:30

前提・実現したいこと

open dynamics engineという物理シミュレータを導入しようとしているのですが,./configureが通りません.
環境はmacOS Mojava(10.14.6)です.

発生している問題・エラーメッセージ

実行すると以下のようなエラーが発生します.

checking build system type... x86_64-apple-darwin18.7.0 checking host system type... x86_64-apple-darwin18.7.0 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make sets $(MAKE)... (cached) yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/Users/me/Downloads/ode-0.16': configure: error: cannot run C++ compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details

gccがそもそも使えない状態です.ヘッダファイルがないと言われてしまいます.
homebrewでインストールしたgcc-7なら通るですが….

hello.c:1:19: fatal error: stdio.h: No such file or directory #include <stdio.h> ^ compilation terminated.

###該当のソースコード
文字数の関係で途中までなのですが,
config.log

This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ODE configure 0.16, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure ## --------- ## ## Platform. ## ## --------- ## hostname = ms06ssnoMacBook-puro-3.local uname -m = x86_64 uname -r = 18.7.0 uname -s = Darwin uname -v = Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 /usr/bin/uname -p = i386 /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = Mach kernel version: Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 Kernel configured for up to 4 processors. 2 processors are physically available. 4 processors are logically available. Processor type: x86_64h (Intel x86-64h Haswell) Processors active: 0 1 2 3 Primary memory available: 16.00 gigabytes Default processor set: 423 tasks, 2301 threads, 4 processors Load average: 3.38, Mach factor: 1.16 /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/opt/openssl@1.1/bin PATH: /usr/local/opt/curl/bin PATH: /usr/local/bin PATH: /usr/bin PATH: /bin PATH: /usr/sbin PATH: /sbin PATH: /Library/TeX/texbin PATH: /usr/local/share/dotnet PATH: /opt/X11/bin PATH: ~/.dotnet/tools PATH: /Library/Frameworks/Mono.framework/Versions/Current/Commands ## ----------- ## ## Core tests. ## ## ----------- ## configure:2765: checking build system type configure:2779: result: x86_64-apple-darwin18.7.0 configure:2799: checking host system type configure:2812: result: x86_64-apple-darwin18.7.0 configure:2849: checking for a BSD-compatible install configure:2917: result: /usr/bin/install -c configure:2928: checking whether build environment is sane configure:2983: result: yes configure:3134: checking for a thread-safe mkdir -p configure:3173: result: ./install-sh -c -d configure:3180: checking for gawk configure:3210: result: no configure:3180: checking for mawk configure:3210: result: no configure:3180: checking for nawk configure:3210: result: no configure:3180: checking for awk configure:3196: found /usr/bin/awk configure:3207: result: awk configure:3218: checking whether make sets $(MAKE) configure:3240: result: yes configure:3269: checking whether make supports nested variables configure:3286: result: yes configure:3415: checking whether make sets $(MAKE) configure:3437: result: yes configure:3504: checking for g++ configure:3520: found /usr/local/bin/g++ configure:3531: result: g++ configure:3558: checking for C++ compiler version configure:3567: g++ --version >&5 g++ (Homebrew GCC 4.9.4_1) 4.9.4 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3578: $? = 0 configure:3567: g++ -v >&5 Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc@4.9/4.9.4_1/libexec/gcc/x86_64-apple-darwin17.3.0/4.9.4/lto-wrapper Target: x86_64-apple-darwin17.3.0 Configured with: ../configure --build=x86_64-apple-darwin17.3.0 --prefix=/usr/local/Cellar/gcc@4.9/4.9.4_1 --libdir=/usr/local/Cellar/gcc@4.9/4.9.4_1/lib/gcc/4.9 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --enable-plugin --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew GCC 4.9.4_1' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues MAKEINFO=missing --disable-nls --enable-multilib Thread model: posix gcc version 4.9.4 (Homebrew GCC 4.9.4_1) configure:3578: $? = 0 configure:3567: g++ -V >&5 g++: error: unrecognized command line option '-V' g++: fatal error: no input files compilation terminated. configure:3578: $? = 1 configure:3567: g++ -qversion >&5 g++: error: unrecognized command line option '-qversion' g++: fatal error: no input files compilation terminated. configure:3578: $? = 1 configure:3598: checking whether the C++ compiler works configure:3620: g++ conftest.cpp >&5 configure:3624: $? = 0 configure:3672: result: yes configure:3675: checking for C++ compiler default output file name configure:3677: result: a.out configure:3683: checking for suffix of executables configure:3690: g++ -o conftest conftest.cpp >&5 configure:3694: $? = 0 configure:3716: result: configure:3738: checking whether we are cross compiling configure:3746: g++ -o conftest conftest.cpp >&5 conftest.cpp:11:19: fatal error: stdio.h: No such file or directory #include <stdio.h> ^ compilation terminated. configure:3750: $? = 1 configure:3757: ./conftest ./configure: line 3759: ./conftest: No such file or directory configure:3761: $? = 127 configure:3768: error: in `/Users/araki/Downloads/ode-0.16': configure:3770: error: cannot run C++ compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details

試したこと

何らかのサイトで,Xcode Command Line toolを入れて解決したという記事を見かけたので,導入したのですが上手くいっていません.

こちらのサイトを参考に,以下のコマンドを入力することで解決できるのかと思ったのですが,そもそもCommandLineToolsのディレクトリにPackegesが存在していません.

/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

解決しようと思っていろいろしすぎたというのと,以前にしていたことが悪さをしている可能性もあります.
./configureを問題なく実行するためにはどうすれば良いかわかるかたいらっしゃいませんか?
ちなみにこのあとには,make → sudo make installを実行する予定です.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

質問には、以下の二つの問題が書かれているのだと思います。
(1)「./configureが通りません」("./configure"を実行したところ、質問に書かれた1つ目のエラー表示が出る。
(2)"hello.c"というC言語のプログラムをコンパイルしたところ、「ヘッダファイルがない」とのエラー表示がでる。

(1)のほうは、「See config.log' for more details」([直訳]詳しくは、config.log'を見てね)とのメッセージが出ているのですから、`config.log'の内容を確認してください。
config.logの内容を質問に追加すると、それを読み解いてもらえるかも知れません。

(2)のほうは、"hello.c"というC言語のプログラムをコンパイルした結果、表示されるものです。
『gccがそもそも使えない状態です.ヘッダファイルがないと言われてしまいます.』と書かれていますが、

1つ目のエラー表示の中に

checking whether the C++ compiler works... yes

[直訳] どこかに使えるC++コンパイラがあるかチェック・・・yes(ありました)
とあります。

更に、2つ目のエラー表示はコンパイラが出力したものですから、コンパイラ(gcc)は使える状態なのだと考えたほうが良いと思います。

コンソールに"which gcc"とコマンドを打てば、gccの所在が表示されますから、確認してみてください。

 "#include <stdio.h>"でエラーが出るのは、インクルードパス(#includeで指定されたファイルの所在を探す場所のリスト)の設定が正しくないからだと思われます。

投稿2019/12/01 07:12

coco_bauer

総合スコア6915

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ToshiyukiAraki

2019/12/01 10:44 編集

includeのパスをいつの間にか変更してしまっていました. Command Line Toolsを入れ直すことで, /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg を実行することができ,全て解決しました.ありがとうございました.
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問