前回、makeの実行まではできたもののコンパイルには失敗した。 今回は吐き出されたファイル一式を解析して原因をさぐる。
shを追ってみた
テキストエディタで以下のようにファイルを見てみた。
C:\MinGW\msys\1.0\home
配下の00_all.sh
ファイルを見る。01_libsigc++.sh
ファイルを見る。C:\MinGW\msys\1.0\home\libsigc++-2.2.11
のconfigure
ファイルを見る。2万行近いshだった。- 見てられないので
config.log
を見る。 - 最後の行が
configure: exit 1
だった。異常終了ってこと? - 何のエラーかわからない。それっぽいログがないか探したが見つからず。
01_libsigc++.sh
ファイルでは、以下の通りログがでるはず。
./configure -h 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-help.log
./configure ${CFGPARMS} 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-config.log
#make clean
make 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-make.log
make install 2>&1 | tee ../logs/${PREFIX}_${PKGNAME}-install.log
よくよく見てみると、前回の手順 9) で log
ディレクトリを作成していたが、logs
だったっぽい。
だからlogファイルができなかったのか。
http://www.giuspen.com/2014/02/build-gtkmm-3-6-0-windows-binaries-on-official-gtk-3-6-4-bundle/
4回目
ディレクトリ名をlog
からlogs
に変更して、もう一度やる。
00_all.sh
を実行する。前回にひきつづき、これで4回目…。
C:\MinGW\msys\1.0\msys.bat
を実行cd C:/MinGW/msys/1.0/home
コマンドを打つsh 00_all.sh
コマンドを打つ
logs
logsディレクトリ配下にログができていた。
01_libsigc++-config.log
checking for gm4... no
checking for m4... no
configure: error: in `/usr/home/libsigc++-2.2.11':
configure: error: The GNU M4 macro processor is required for building libsigc++.
See `config.log' for more details
下の5行。どうやらM4
というマクロプロセッサ?が必要らしい。
M4の入手
choco install M4
chocorateyでインストールを試みるも失敗。
>choco install M4
Chocolatey v0.10.0
Installing the following packages:
M4
By installing you accept licenses for the packages.
M4 not installed. The package was not found with the source(s) listed.
If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
Version: ""
Source(s): "https://chocolatey.org/api/v2/"
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\Documents and Settings\All Users\Application Data\c
hocolatey\logs\chocolatey.log).
Failures
- M4 - M4 not installed. The package was not found with the source(s) listed.
If you specified a particular version and are receiving this message, it is pos
sible that the package name exists but the version does not.
Version: ""
Source(s): "https://chocolatey.org/api/v2/"
Wikipedia
M4は汎用テキストマクロプロセッサ。
GNU
FTPサーバで配布されているが、拡張子から察するにUnix環境用。 Windows用バイナリがほしい。
- "m4 windows binary"で検索する
- こちらのサイトを見つける
- Binariesから
m4-1.4.14-1-bin.zip
ファイルがダウンロードされる - 解凍すると
m4-1.4.14-1-bin
ディレクトリができる bin
ディレクトリ内にm4.exe
がある- 起動してみる
- 以下のエラーが出た 「regex2.dllが見つからなかったため、このアプリケーションを開始できませんでした。アプリケーションをインストールしなおすとこの問題は解決される場合があります。」
regex2.dll
- "regex2.dll download"でググる
- こちらのサイトを見つける
- Binariesから
regex-2.7-bin.zip
ファイルがダウンロードされる - 解凍すると
regex-2.7-bin
ディレクトリができる bin
ディレクトリ内にregex2.dll
がある
エラー除去できた
とりあえずm4.exeとおなじディレクトリに配置して起動してみると、エラーは出なくなっていた。
あとはこのままどこかに配置して環境変数のPathに通してやれば、00_all.sh
の「checking for m4... no」が「checking for m4... yes」になるかもしれない。
配置して環境変数のパスを通す
C:/MinGW/msys/1.0/home
配下にm4-1.4.14-1-bin
ディレクトリを配置するC:/MinGW/msys/1.0/home/m4-1.4.14-1-bin/bin
を環境変数のPathに追加する
もしくは00_all.sh
が「checking whether make sets $(MAKE)...」で止まったときのように、環境変数の名前を"M4"にする必要があるかもしれない。
エラーメッセージは以下の通りで、$(M4)
とは書いていない。
checking for gm4... no
checking for m4... no
configure: error: in `/usr/home/libsigc++-2.2.11':
configure: error: The GNU M4 macro processor is required for building libsigc++.
See `config.log' for more details
なので、とりあえず環境変数"Path"に追記しておく。
5回目
C:\MinGW\msys\1.0\msys.bat
を実行cd C:/MinGW/msys/1.0/home
コマンドを打つsh 00_all.sh
コマンドを打つ
コンソール
コンソールを見ていると、以下を発見。
checking for gm4... no
checking for m4... m4
checking for perl... perl
checking for dot... dot
checking for doxygen... doxygen
checking for xsltproc... xsltproc
前回は以下だった。
checking for gm4... no
checking for m4... no
たぶん"no"となっているのが、存在しないものなのだろう。
ためしにテキトーなタイミングでコンソールをコピペして"checking ... no"っぽいのを探してみたら、以下のようなものが見つかった。
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... no
checking for gm4... no
これらが何なのかさっぱりわからない。本当にWindowsXPでコンパイルできるの?
01_libsigc++-config.log
すこし時間を待って、C:\MinGW\msys\1.0\home\logs
にある01_libsigc++-config.log
をみてみる。
たぶん01_libsigc++-config.log
が最初に終わる。
テキストエディタで見てみる。
前回は以下のようにエラーで終わっていた。
checking for gm4... no
checking for m4... no
configure: error: in `/usr/home/libsigc++-2.2.11':
configure: error: The GNU M4 macro processor is required for building libsigc++.
See `config.log' for more details
今回は以下のように続いている。
checking for gm4... no
checking for m4... m4
checking for perl... perl
checking for dot... dot
checking for doxygen... doxygen
checking for xsltproc... xsltproc
configure: WARNING: Perl is required for installing the documentation.
checking for pkg-config... /c/gtkmm/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking if C++ compiler supports the use of a particular specialization when calling operator() template methods.... yes
checking if C++ compiler supports the use of a particular specialization when calling operator() template methods omitting the template keyword.... yes
checking if C++ compiler allows usage of member function in initialization of static member field.... yes
checking whether C++ library symbols are declared in namespace std... yes
checking for non-standard Sun libCstd reverse_iterator... no
checking which C++ compiler warning flags to use... -Wall
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sigc++-2.0.pc
config.status: creating sigc++-2.0-uninstalled.pc
config.status: creating sigc++/Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating docs/Makefile
config.status: creating docs/reference/Doxyfile
config.status: creating MSVC_Net2005/sigc.rc
config.status: creating MSVC_Net2008/sigc.rc
config.status: creating MSVC_Net2010/sigc.rc
config.status: creating config.h
config.status: creating sigc++config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing MSVC_Net2005/sigc++config.h commands
config.status: executing MSVC_Net2008/sigc++config.h commands
config.status: executing MSVC_Net2010/sigc++config.h commands
"error"の文字はない。成功したのか?
C:\MinGW\msys\1.0\gtkmm3\bin
をみてみると、libsigc-2.0-0.dll
ができていた。
え、成功なの?成功したっぽい。
他のライブラリも順次作成中っぽい。
次回
成功なら、次はこれをどうやって使うか。 MinGWにてgtkmm3のHelloWorldをコンパイルしたい。
その前に、MinGWでどうやってコンパイルするのか。 多分makeファイルを書かねばならない。 gccやg++コマンドを使うのだろうが、引数などもわからない。
次回はMinGWでHelloWorldか。