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

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

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

Cygwinは、Unixのような環境を、Windows上で構築させるコマンドラインインターフェースです。

Q&A

解決済

2回答

7163閲覧

cygwin上での configure エラー

fire

総合スコア13

Cygwin

Cygwinは、Unixのような環境を、Windows上で構築させるコマンドラインインターフェースです。

0グッド

0クリップ

投稿2016/12/14 03:26

SPTKという音声解析ツールを
Windows上で動かすために、Cygwin上でインストールしたいと思っております。

./configure
make
sudo make install

でエラーメッセージが出なければインストール完了になるはずなのですが、configureでエラーが出て、そのたびに必要と思われるパッケージをインストールしつつcygwinの再セットアップを繰り返しましたが

checking whether we are cross compiling... no
checking whether gcc needs -traditional... no

上記の二つのみ原因がわからず(正確にはconfigureの段階ではエラーにはならない)のちのmakeが通りません。

原因がわかる方いらっしゃいましたらご教授お願い申し上げます。

fire@LAPTOP-BV21M1N2 /cygdrive/c/SPTK-3.9 $ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking whether ln -s works... yes checking for ranlib... ranlib checking for ar... ar checking for csh... /usr/bin/csh checking for log in -lm... yes checking how to run the C preprocessor... gcc -E checking for X... libraries , headers checking for gethostbyname... yes checking for connect... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking for an ANSI C-conforming const... yes checking for size_t... yes checking build system type... x86_64-unknown-cygwin checking host system type... x86_64-unknown-cygwin checking whether gcc needs -traditional... no checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for working strtod... yes checking for pow... yes checking for sqrt... yes checking for bzero... yes checking for memset... yes checking for strrchr... yes checking for rindex... yes checking audio device... windows checking windows.h usability... yes checking windows.h presence... yes checking for windows.h... yes checking for main in -lwinmm... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile ~中略~ config.status: creating script/Makefile config.status: executing depfiles commands fire@LAPTOP-BV21M1N2 /cygdrive/c/SPTK-3.9 $ make Making all in include make[1]: ディレクトリ '/cygdrive/c/SPTK-3.9/include' に入ります make[1]: 'all' に対して行うべき事はありません. make[1]: ディレクトリ '/cygdrive/c/SPTK-3.9/include' から出ます Making all in lib make[1]: ディレクトリ '/cygdrive/c/SPTK-3.9/lib' に入ります depbase=`echo fileio.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -DPACKAGE_NAME=\"SPTK\" -DPACKAGE_TARNAME=\"SPTK\" -DPACKAGE_VERSION=\"3.9\" -DPACKAGE_STRING=\"SPTK\ 3.9\" -DPACKAGE_BUGREPORT=\"http://sourceforge.net/pro jects/sp-tk/\" -DPACKAGE_URL=\"\" -DPACKAGE=\"SPTK\" -DVERSION=\"3.9\" -DHAVE_LI BM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHA VE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB _H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_BZERO=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -DHAVE_RINDEX=1 -DFORMAT=\"float\" -DWIN32=1 -DHAVE_LIBWINMM=1 -I ../include -g -O2 -MT fil eio.o -MD -MP -MF $depbase.Tpo -c -o fileio.o fileio.c &&\ mv -f $depbase.Tpo $depbase.Po fileio.c: 関数 ‘freada’ 内: fileio.c:78:13: 警告: 関数 ‘_fileno’ の暗黙的な宣言です [-Wimplicit-function-dec laration] _setmode(_fileno(fp), _O_TEXT); ^ fileio.c:78:26: エラー: ‘_O_TEXT’ が宣言されていません (この関数内での最初の使用 ) _setmode(_fileno(fp), _O_TEXT); ^ fileio.c:78:26: 備考: 未宣言の識別子は出現した各関数内で一回のみ報告されます fileio.c: 関数 ‘fwritex’ 内: fileio.c:95:26: エラー: ‘_O_BINARY’ が宣言されていません (この関数内での最初の使 用) _setmode(_fileno(fp), _O_BINARY); ^ fileio.c: 関数 ‘freadx’ 内: fileio.c:104:26: エラー: ‘_O_BINARY’ が宣言されていません (この関数内での最初の 使用) _setmode(_fileno(fp), _O_BINARY); ^ fileio.c: 関数 ‘fwritef’ 内: fileio.c:143:26: エラー: ‘_O_BINARY’ が宣言されていません (この関数内での最初の 使用) _setmode(_fileno(fp), _O_BINARY); ^ fileio.c: 関数 ‘freadf’ 内: fileio.c:160:26: エラー: ‘_O_BINARY’ が宣言されていません (この関数内での最初の 使用) _setmode(_fileno(fp), _O_BINARY); ^ make[1]: *** [Makefile:1367: fileio.o] エラー 1 make[1]: ディレクトリ '/cygdrive/c/SPTK-3.9/lib' から出ます make: *** [Makefile:428: all-recursive] エラー 1

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

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

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

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

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

guest

回答2

0

ベストアンサー

回答でないのですが

checking whether we are cross compiling... no

checking whether gcc needs -traditional... no

1番目はクロスコンパイルではないのでnoになった、2番目は古い仕様(ANSI以前?)でのコンパイルは必要ないと判断されたのでnoになった、つまりいずれもそれが直接問題であることを意味しないと思います。

コンパイルエラーの内容をみた感じだとシステムにインストールされているヘッダーファイルの内容が本来期待されているものと互換性のないものになっている(例えば_O_BINARYはsys/fcntl.hで定義されているO_BINARYのことだと思えます)のが原因に見えますが、なぜ矛盾がおきているかは分かりませんでした。cygwinでSPTKをインストールしたという記事を見かけましたが「こういうトラブルがあってこう対処した」みたいな丁寧な記事は見当たらないのでこういった問題はインストールしようとする人が適当に対処するということなのでしょうか・・・


追記:
当方cygwin64の環境(ただし標準以外をinstallしたことがないので適当に必要なパッケージを入れてあるだけのもの)ですが、上記のsys/fcntl.hというのはcygwin64にあるヘッダーという意味です。cygwin64ではO_BINARYは定義されていますが_O_BINARYは定義されてないようです。これら2つのシンボルは同じ意味だと思いますが。

投稿2016/12/14 04:27

編集2016/12/14 04:32
KSwordOfHaste

総合スコア18394

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

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

KSwordOfHaste

2016/12/14 06:03

本件に間違いがあったでしょうか。もしよろしければご指摘いただければ幸いです。訂正または取り消しいたします。
fire

2016/12/19 22:31

詳しい回答ありがとうございます。 返信がおそくなり申し訳ございません。 自分のcygwin64内のsys/fcntl.hを調べてみると、O_BINARYも_O_BINARYも定義されているようでした。(ヘッダファイル内に #define _O_BINARY 0x8000 #define O_BINARY _O_BINARY の記述あり) 仰せの通り、cygwin64とSPTK-3.9との互換性がなかったのか、SPTKの旧バージョン(3.9ではなく、3.5)で行ったところ_O_BINARYに関するエラーは出なくなりました。ありがとうございます。 (これもmake installまでエラーなしで通るが、実際にSPTK用のコマンドを用いると、-bash:コマンドが見つかりませんエラーが出る)
KSwordOfHaste

2016/12/20 04:39

上の回答の後たまたまg++追加インストールして環境が変わったためなのか、最初調べ間違いしたのか定かではありませんが、今は'/usr/include/sys/_default_fcntl.h:#define O_BINARY _FBINARY'と定義されてました。入れているものによってヘッダーが違うのは不思議ではないのでやはりこういうときには自分の環境を調べるしかないようです。
fire

2016/12/21 08:16

なるほど。よくよく調べてみます。ありがとうございました。
guest

0

configure の二つの no は、

  • checking whether we are cross compiling... no <-- クロスコンパイル(コンパイル環境とターゲット環境が異なる)か否か
  • checking whether gcc needs -traditional... no <-- gcc に -traditional オプションを付ける必要があるか

なので、問題なしです。

実際の make 中のエラーからすると、_O_TEXT 他が未定義と言っています。
※UNIX だと O_TEXT のような気がするのですが……Windows 向けにコンパイルするからこちらになっている?

地道にソースを修正した方がよいような気はします。

投稿2016/12/14 04:01

編集2016/12/14 04:03
tacsheaven

総合スコア13703

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

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

fire

2016/12/19 22:18

回答ありがとうございます。 返信がおそくなり申し訳ございません。 OSごとの違いなのですか。 仰せの通りSPTKの旧バージョン(3.9ではなく、3.5)で行ったところ_O_BINARYに関するエラーは出なくなりました。ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問