【问题标题】:Compilation of cmake failscmake 编译失败
【发布时间】:2014-01-28 02:38:35
【问题描述】:

当我尝试从 MinGW MSYS2 系统上的源代码编译 cmake2.8.12.2 时,运行 sh bootstrap 后出现以下错误:

make: 没有规则来制作目标 '/cygdrive/e/software/pkg/cmake-2.8.12.2/Source /cmStandardIncludes.cxx','cmStandardIncludes.o' 需要。停下来。

我检查了源目录,发现 cmStandardIncludes.cxx。请在这方面提供帮助。谢谢。

输出:

E:\software\pkg\cmake-2.8.12.2>sh bootstrap
---------------------------------------------
CMake 2.8.12.2, Copyright 2000-2012 Kitware, Inc.
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: make
g++ is GNU compiler
g++ does not have setenv
g++ does not have unsetenv
g++ has environ in stdlib.h
g++ has STL in std:: namespace
g++ has ANSI streams
g++ has streams in std:: namespace
g++ has sstream
g++ has operator!=(string, char*)
g++ has stl iterator_traits
g++ has standard template allocator
g++ has allocator<>::rebind<>
g++ does not have non-standard allocator<>::max_size argument
g++ has stl containers supporting allocator objects
g++ has header cstddef
g++ requires template friends to use <>
g++ supports member templates
g++ has standard template specialization syntax
g++ has argument dependent lookup
g++ does not have struct stat with st_mtim member
g++ has ios::binary openmode
g++ has ANSI for scoping
---------------------------------------------
make: *** No rule to make target '/cygdrive/e/software/pkg/cmake-2.8.12.2/Source
/cmStandardIncludes.cxx', needed by 'cmStandardIncludes.o'.  Stop.
---------------------------------------------
Error when bootstrapping CMake:
Problem while running make
---------------------------------------------
Log of errors: /cygdrive/e/software/pkg/cmake-2.8.12.2/Bootstrap.cmk/cmake_boots
trap.log
---------------------------------------------

【问题讨论】:

    标签: cmake mingw msys2


    【解决方案1】:

    如果你想使用 MinGW 编译器,我建议你使用 MinGW shell prompt 而不是 cygwin。这样可以确保正确设置了几个 MinGW 编译器特定的环境变量。

    注意,如果您使用 MSYS,您必须使用“MSYS Makefiles”生成器,并且应该简单地调用 make 程序 make(如果您已正确安装它),而如果您使用“MinGW Makefiles”作为生成器,您必须使用mingw32-make 作为 make 程序。

    如果您生成“MinGW Makefiles”并调用 make,则会调用错误的 make 程序。明确指定 mingw32-make

    【讨论】:

    • 非常感谢您的建议。我将 sh 重命名为 sh1 并使用 MinGW Makefiles 生成器来编译 cmake。构建成功。
    猜你喜欢
    • 2014-06-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-07
    • 2022-11-30
    • 1970-01-01
    • 2021-10-07
    • 2015-01-22
    • 1970-01-01
    相关资源
    最近更新 更多