Cygwin 是否有人使用MinGW/MSYS成功编译了freetype?
我尝试用MinGW/MSYS编译freetype失败 我是这样做的: 从Cygwin 是否有人使用MinGW/MSYS成功编译了freetype?,cygwin,mingw,gnu-make,freetype,cygpath,Cygwin,Mingw,Gnu Make,Freetype,Cygpath,我尝试用MinGW/MSYS编译freetype失败 我是这样做的: 从cmd.exeI切换到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: p
cmd.exe
I切换到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'.
配置freetype后,我想使用make
编译源代码:
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
由于编译指令要求gnu制作,我验证了这一点:
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
我做错了什么
Edit:目录中还有Makefile.mingw
。尝试使用make-f Makefile.mingw启动编译过程也没有完成,返回消息¨make:**没有规则将目标设置为“MFSED”,这是“all”所需的。停止。
更新好的,我已经对这件事做了一些调查,看来问题的关键在于我没有安装CygWin。我有这个假设是因为cygpath
是一个CygWin实用程序(),它将unix路径转换为windows路径,反之亦然
现在,一个¨查找-类型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
我想我必须在这些位置中的一个或多个位置改变一些东西来修复构建。对吗?我仍然希望对整个./configure构建过程有更多了解的人能给我一个关于这个问题的提示
更新II:根据rubenvb的回答,我想我可以尝试/configure--build=i686-pc-mingw32
,然后删除行读数
TOP_DIR := $(shell cd $(TOP_DIR); cygpath -m `pwd`)
在builds/unix/unix def.mk
中,然后更改行读数
RCTOOL_COMPILE = RCTOOL
到
在/builds/freetype.mk
中,并复制到c:\mingw\bin
(由于缺少rctool.sh
,因此出现了奇怪的错误),然后使用make
启动编译过程
现在,源文件的编译似乎(至少部分)终于完成了,尽管我收到了很多类似的警告
./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'
我猜编译警告与链接器错误并非无关
那么,现在怎么办?一般来说,在Windows上编译unix/linux软件可以有两种方式:
使用MSYS或Cygwin中现有的配置脚本
使用cmd.exe(windows shell)提供的mingw makefile
你试了第一个(但我认为不够努力),但第二个错了:
尝试传递--host=i686-pc-mingw32
进行配置。脚本告诉您它检测到一个unix构建,这是一个可怕的错误,正如您所看到的,无法工作
您还可以直接从cmd.exe使用mingw32 make
来使用找到的makefile.mingw。它应该很好用
尝试在主源目录中查找自述文件或安装文件。它应该告诉您该做什么,并且可能有一个特定于windows的部分。感谢您的宝贵帮助。不幸的是,两个选项都没有改变任何内容,它们仍然会产生与缺少的cygpath
相关的相同错误。我找到了一个自述文件(实际上称为INSTALL.UNIX和UPGRADE.UNIX,这两个文件都明确规定供MinGW/MSYS使用)和“告诉我做我已经做过的事情”。我并不认为我不够努力(虽然我已经花了4-5个小时),但这不是整件事的重点。/配置不必担心不同的平台形式?嗯,在msys环境中不应该需要cygpath。你确定使用mingw32 make从windows控制台使用mingw makefile(cmd.exe)不起作用吗?当我在C:\temp\freetype-2.3.5-1\src\freetype\2.3.5\freetype-2.3.5
中打开cmd.exe和cd并执行mingw32-make.exe-f makefile.mingw
时,在打印了很多行之后,它最终打印了mingw32 make:**No rule to make target
MFSED',这是all'需要的。停止。
@René:那么他们的makefile有问题了。但是你的目录结构很深(可能与你的问题无关…),谢谢你的帮助。我解压数据源时一定出了什么问题。我下载了另一个源zip文件,它目前正在构建库。这一次似乎会奏效。
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'