9

MinGW/MSYSでFreeTypeをコンパイルしようとして失敗しました

これが私がすることです:

cmd.exe私が切り替えてからMSYS

C:\temp\freetype-2.3.5-1\src\freetype\2.3.5\freetype-2.3.5>bash

そして、configureスクリプトを呼び出します

bash-3.1$ ./configure

FreeType build system -- automatic system detection

The following settings are used:

  platform                    unix
  compiler                    cc
  configuration directory     ./builds/unix
  configuration rules         ./builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).

cd builds/unix; ./configure
checking build system type... i686-pc-mingw32

[------ Deleted some 121 lines because they seem irrelevant for the problem ------]

config.status: creating ftconfig.h
make: Nothing to be done for `unix'.

makefreetypeを設定した後、ソースをコンパイルするために使用したいと思います。

bash-3.1$ make
/bin/sh: cygpath: command not found
config.mk:36: /builds/freetype.mk: No such file or directory
config.mk:57: /builds/unix/install.mk: No such file or directory
builds/toplevel.mk:158: /builds/modules.mk: No such file or directory
make: *** No rule to make target `/builds/modules.mk'.  Stop.

問題はcygpathにあるようですが、これはcygwinをインストールしていないので奇妙です。

コンパイル命令はgnumakeを義務付けているので、私はこれを検証しました:

bash-3.1$ make -v
GNU Make 3.81
Copyright (C) 2006  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.

This program built for i686-pc-msys

私は何を間違えますか?

編集Makefile.mingw:ディレクトリにもあります。でコンパイルプロセスを開始しようとしてmake -f Makefile.mingwも終了せず、メッセージが返されます¨make: *** No rule to make target 'MFSED', needed by 'all'. Stop.

更新OK、私はこの問題についていくつかの探偵調査を行いましたが、 CygWinをインストールしていないため、問題は正確にあるようです。unix-pathsをwindows-pathsに、またはその逆に変換cygpathするCygWinユーティリティ(ここを参照)であるため、私はこの仮定を持っています。

ここで、が使用され¨find . -type f -exec grep -l cygpath {} \;ている場所をいくつか見つけます。cygpath

  • ./builds/unix/aclocal.m4
  • ./builds/unix/configure
  • ./builds/unix/unix-def.in
  • ./builds/unix/unix-def.mk
  • ./patches/freetype-2.3.4.diff
  • ./patches/freetype-2.3.5/builds/unix/unix-def.mk
  • ./patches/freetype-2.3.5.diff

ビルドを修正するには、これらの場所の1つ以上で何かを変更する必要があると思います。右?./configure-buildプロセス全体についてより多くの知識を持っている人が、この問題に関するヒントを教えてくれることを今でも望んでいます。

アップデートIIrubenvbの回答から、次の行削除してみ./configure --build=i686-pc-mingw32てください。

TOP_DIR := $(shell cd $(TOP_DIR); cygpath -m `pwd`)

builds/unix/unix-def.mk、行の読みを変更します

RCTOOL_COMPILE = RCTOOL

RCTOOL_COMPILE = $(RCTOOL)

http://gnuwin32.sourceforge.net/rctool.sh.txtをに./builds/freetype.mkコピーし(欠落しているために奇妙なエラーが発生したため)、コンパイルプロセスを。で開始しますc:\mingw\binrctool.shmake

さて、ソースファイルのコンパイルは(少なくとも部分的に)ついに完了したように見えましたが、私は次 のような多くの警告を受けました

./src/base/ftcalc.c:75:3: warning: 'FT_RoundFix' redeclared without dllimport attribute: previous dllimport ignored

しかし、リンカは* .oファイルをリンクできません。これは、次のような未定義の参照が多数あるためです。

C:\temp\freetype-2.3.5-1\src\freetype\2.3.5\freetype-2.3.5/src/base/ftinit.c:89: undefined reference to `_imp__FT_Add_Module'

コンパイル警告はリンカーエラーとは無関係ではないと思います。

ならどうしよう?

4

1 に答える 1

4

一般に、WindowsでUNIX / Linuxソフトウェアをコンパイルするには、次の2つの方法があります。

  1. MSYSまたはCygwinの既存の構成スクリプトを使用します。

  2. cmd.exe(Windowsシェル)から提供されたmingwmakefileを使用します。

あなたは最初のものを試しましたが(しかし、私は十分に難しいとは思いません)、2番目のものを間違ってしました:

  1. 合格--host=i686-pc-mingw32して設定してみてください。スクリプトは、UNIXビルドを検出したことを示していますが、これはひどく間違っており、ご覧のとおり、機能しません。

  2. mingw32-makecmd.exeから直接使用して、見つけたmakefile.mingwを使用することもできます。正常に動作するはずです。

メインのソースディレクトリでREADMEまたはINSTALLファイルを見つけてください。それはあなたに何をすべきかを教えてくれるはずで、おそらくウィンドウズ特有のセクションがあります。

于 2011-02-14T21:36:10.763 に答える