【问题标题】:Directory change error with mingw32-makemingw32-make 的目录更改错误
【发布时间】:2015-07-08 13:01:45
【问题描述】:

我正在 MinGW32 下构建 POCO 库 1.6.0,环境:Windows 7 Ultimate 32 位,shell:MSYS。成功执行./configure.

$ ./configure
Configured for MinGW

config.make 的内容:

POCO_CONFIG = MinGW
POCO_BASE = /c/dev/poco
POCO_BUILD = /c/dev/poco
POCO_PREFIX = /usr/local
POCO_FLAGS = 
OMIT = 
export POCO_CONFIG
export POCO_BASE
export POCO_BUILD
export POCO_PREFIX
export POCO_FLAGS

启动 mingw32-make 后,我得到:

$ mingw32-make --debug -w
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File `poco' does not exist.
   File `libexecs' does not exist.
     File `Foundation-libexec' does not exist.
    Must remake target `Foundation-libexec'.
Invoking recipe from Makefile:69 to update target `Foundation-libexec'.
mingw32-make: Entering directory `c:/dev/poco'
C:/app/MinGW/bin/mingw32-make -d -C /c/dev/poco/Foundation
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.
mingw32-make: Leaving an unknown directory
mingw32-make: *** [Foundation-libexec] Error 2
mingw32-make: Leaving directory `c:/dev/poco'

问题出在

mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.

因为 /c/dev/poco/Foundation 确实存在:

$ ls
CHANGELOG       LICENSE   VERSION                  build_vs110.cmd  config.make
CMakeLists.txt  MANIFEST  XML                      build_vs120.cmd  configure
CONTRIBUTORS    Makefile  build                    build_vs90.cmd   contrib
CppUnit         NEWS      build_CE_vs90.cmd        buildwin.cmd     doc
DLLVersion.rc   Net       build_vcexpress2008.cmd  cmake            libversion
Foundation      README    build_vcexpress2010.cmd  components       patches
JSON            Util      build_vs100.cmd          config.build

我正在修改 makefile 以将目录更改为其他子文件夹,不高兴。似乎有些东西阻止了 mingw32-make 更改目录。也可以确认

cd /c/dev/poco/Foundation

工作正常。

用make试过,结果是一样的:

$ make --debug -w
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File `poco' does not exist.
   File `libexecs' does not exist.
     File `Foundation-libexec' does not exist.
    Must remake target `Foundation-libexec'.
Invoking recipe from Makefile:69 to update target `Foundation-libexec'.
make: Entering directory `c:/dev/poco'
C:/app/MinGW/msys/1.0/bin/make -d -C /c/dev/poco/Foundation
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
make: Entering an unknown directory
make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.
make: Leaving an unknown directory
make: *** [Foundation-libexec] Error 2
make: Leaving directory `c:/dev/poco'

没有明显的原因导致 mingw32-make 失败,因为路径没有空格。

我错过了什么?欢迎提出任何建议。

【问题讨论】:

  • 您使用的是哪个build configuration?你跑configure了吗? $POCO_BASE 的值是多少?
  • 我做了,扩展原帖回答你的问题
  • 我已经安装了最新的 MinGW 环境并且构建工作正常;当然,与 MinGW 特定的修改,但这是一个不同的故事。所以问题至少出在 make.exe 上,也许还有其他问题,因为环境已经很老了。

标签: makefile mingw mingw32 poco-libraries


【解决方案1】:

在mingw32-make.exe 的上下文中,路径/c/dev/poco/Foundation 并不代表您的想法。看,mingw32-make.exe 是一个本机 Windows 应用程序,所以它肯定将不理解MSYS 特定路径,例如/c/dev/poco/Foundation;相反,它将“按原样”解释为c:/c/dev/poco/Foundation,(假设您当前的工作驱动器是c:),我确定这不是您想要的。

您似乎确实使用MSYS 作为您的外壳,那么您为什么还要使用mingw32-make.exe?使用MSYS本身提供的make.exe;它确实理解MSYS 路径。

请注意,如果您从 MSYS shell 运行 make --version,您应该看到,(在撰写本文时):

$ make --version
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

在您更新的问题中,您展示了一个运行 make.exe 的示例,这显然 不是这个 MSYS 版本;似乎你已经放置了make.exe的替代版本——甚至可能是mingw32-make.exe本身的副本,因为输出是相同的——在你的@中MSYS版本之前的某个目录中987654338@。你应该删除这个非 MSYS 版本的make.exe;调用 MinGW 版本mingw32-make.exe 的全部目的是避免这种冲突。当您从 MSYS shell 运行 make 时,您需要 MSYS 版本,并且不是一些 mingw32-make.exe 克隆。

【讨论】:

  • 谢谢 Keith,完成了您建议的测试并扩展了描述 - 使用 make.exe 构建后仍然失败
  • @Andriy,那么您需要包含一个 minimal 独立的示例 makefile,它可以演示问题。您确定您的make.exe 来自MSYS? MinGW.org 的当前 official 版本是 GNU-Make-3.81-3,但您的输出显示为 3.82。
  • @Andriy,你的 MSYS make.exe应该声明自己为 GNU Make 3.81,脚注:This program built for i686-pc-msys。您在后续测试中显示的版本看起来更像是mingw32-make.exe 的副本;你需要摆脱它。
  • 你的观察是正确的,我已经发布了答案
猜你喜欢
  • 1970-01-01
  • 2012-11-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-15
  • 1970-01-01
  • 1970-01-01
  • 2023-03-25
相关资源
最近更新 更多