用Cygwin制作 [英] make with Cygwin

查看:64
本文介绍了用Cygwin制作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows上设置VTK(我说这很复杂吗?^^).我已经使用CMake成功配置了VTK,现在尝试通过cygwin运行make.但是,当我转到构建目录并输入make时,将完成所有终端的打印并完成以下操作:

I am trying to set VTK on windows (did I say it was complicated?^^). I have successfully configured VTK with CMake and I am now trying to run make through cygwin. However when I go to the build directory and enter make all the terminal prints and does is:

制作

Microsoft Windows [版本6.3.9600]

Microsoft Windows [version 6.3.9600]

(c)2013 Microsoft Corporation.保留所有权利.

(c) 2013 Microsoft Corporation. All rights reserved.

有人知道怎么了吗?

键入cygcheck时我得到:

when typing cygcheck I get:

Cygwin Package Information
Package              Version        Status
make                 4.0-2           OK

这是我得到的屏幕截图(很抱歉,它是法语的)

EDIT 2: Here is a screenshot of what I get (sorry it's in french)

在此先感谢您提供的帮助:)

Thanks in advance for any help you can give :)

新屏幕截图+ Makefile内容

EDIT 3: New screenshot + Makefile Content

Makefile内容:

Makefile content:

# CMAKE generated file: DO NOT EDIT!
# Generated by "MinGW Makefiles" Generator, CMake Version 3.2

# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target

# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:

    #=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

    #=============================================================================
# Set environment variables for the build.

SHELL = cmd.exe

# The CMake executable.
CMAKE_COMMAND = "C:\Program Files (x86)\CMake\bin\cmake.exe"

# The command to remove a file.
RM = "C:\Program Files (x86)\CMake\bin\cmake.exe" -E remove -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = C:\Users\Lonni\VTK\VTK-6.2.0

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = C:\Users\Lonni\VTK\Build1

    #=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running         CMake cache editor..."
    "C:\Program Files (x86)\CMake\bin\cmake-gui.exe" -H$(CMAKE_SOURCE_DIR) -    B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target rebuild_cache
rebuild_cache:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running     CMake to regenerate build system..."
    "C:\Program Files (x86)\CMake\bin\cmake.exe" -H$(CMAKE_SOURCE_DIR) -    B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
    $(CMAKE_COMMAND) -E cmake_progress_start     C:\Users\Lonni\VTK\Build1\CMakeFiles     C:\Users\Lonni\VTK\Build1\CMakeFiles\progress.marks
    $(MAKE) -f CMakeFiles\Makefile2 all
    $(CMAKE_COMMAND) -E cmake_progress_start     C:\Users\Lonni\VTK\Build1\CMakeFiles 0
.PHONY : all

# The main clean target
clean:
    $(MAKE) -f CMakeFiles\Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
    $(MAKE) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
    $(MAKE) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-    build-system CMakeFiles\Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named vtk-android

# Build rule for target.
vtk-android: cmake_check_build_system
    $(MAKE) -f CMakeFiles\Makefile2 vtk-android
.PHONY : vtk-android

# fast build rule for target.
vtk-android/fast:
    $(MAKE) -f CMakeFiles\vtk-android.dir\build.make CMakeFiles/vtk-    android.dir/build
.PHONY : vtk-android/fast

#=============================================================================
# Target rules for targets named vtk-compile-tools

# Build rule for target.
vtk-compile-tools: cmake_check_build_system
    $(MAKE) -f CMakeFiles\Makefile2 vtk-compile-tools
.PHONY : vtk-compile-tools

# fast build rule for target.
vtk-compile-tools/fast:
    $(MAKE) -f CMakeFiles\vtk-compile-tools.dir\build.make CMakeFiles/vtk-    compile-tools.dir/build
.PHONY : vtk-compile-tools/fast

# Help Target
help:
    @echo The following are some of the valid targets for this Makefile:
    @echo ... all (the default if no target is provided)
    @echo ... clean
    @echo ... depend
    @echo ... vtk-android
    @echo ... edit_cache
    @echo ... rebuild_cache
    @echo ... vtk-compile-tools
.PHONY : help



#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-    build-system CMakeFiles\Makefile.cmake 0
.PHONY : cmake_check_build_system

推荐答案

Cygwin的默认安装为非常小.它不包括GNU make ,因此您正在获得Microsoft的 make .

The default installation of Cygwin is quite minimal. It doesn't include GNU make, so you're getting Microsoft's make.

您需要重新运行Cygwin的 setup-*.exe 并添加 make .可能是,您可能还需要其他东西.我建议打开开发"类别,然后在其中浏览内容.

You need to re-run Cygwin's setup-*.exe and add make. Chances are, you probably need other things, too. I suggest opening the Devel category and giving the contents a scan while you're in there.

编辑:

您的屏幕截图显示了一些困惑.我将逐一介绍它们,并分别引用文本:

Your screenshots show several confusions. I'll go through them one by one, quoting the text in each case:

不可或缺的专有文件和社区文件

用英语表示未指定目标,也未找到任何makefile".这说明您已安装并正在运行GNU make,但是在该目录中没有名为 GNUmakefile makefile Makefile 的文件.当前目录.它按顺序搜索这三个.

In English, that is "No targets specified and no makefile found." This tells you that GNU make is installed and running, but that you don't have a file called GNUmakefile, makefile, or Makefile in the current directory. It searches for those three, in order.

这并不奇怪,因为 ls 显示您正在空目录中运行它.

This is not surprising since ls shows that you are running it in an empty directory.

/cygdrive/c/MinGW/bin/make

这里有两个问题:

  1. 正如我在评论中所说,只有链接到 cygwin1.dll 的程序才能理解/cygdrive .Windows的 cmd.exe 不知道/cygdrive 是什么意思. c:\ MinGW \ bin \ make cmd.exe 下的正确格式.

  1. As I said in the comments, only programs linked to cygwin1.dll can make sense of /cygdrive. Windows' cmd.exe has no idea what /cygdrive means. c:\MinGW\bin\make is the correct form under cmd.exe.

MinGW不是Cygwin.MinGW遇到的任何问题都是完全独立的问题,与Cygwin的GNU make软件包所遇到的问题无关.

MinGW is not Cygwin. Any problems you have with MinGW are an entirely separate question, not related to the problems you're having with Cygwin's GNU make package.

/usr/bin/make

这与上一项相似: cmd.exe 不知道如何处理POSIX路径.由于Windows的文件路径解析代码有时有时将正斜杠与反斜杠相同,因此在这种情况下,它被解释为 c:\ usr \ bin \ make ,但几乎当然根本没有 c:\ usr 目录.

This is similar to the previous item: cmd.exe has no idea what to do with a POSIX path. Because Windows' file path parsing code sometimes treats forward slashes the same as backslashes, this gets interpreted as c:\usr\bin\make in this case, but there is almost certainly no c:\usr directory at all.

此路径在左侧屏幕截图中起作用的原因是Cygwin将您的Cygwin安装目录(例如,默认情况下为 c:\ cygwin c:\ cygwin64 )挂载为POSIX根目录,以使 c:\ cygwin \ usr 在链接到 cygwin1.dll 的任何使用POSIX API的程序中都以/usr 的形式显示作为 open(2) .如您所显示的,其中包括Cygwin的GNU版本的 bash .

The reason this path works in the left screenshot is that Cygwin mounts your Cygwin installation directory (e.g. c:\cygwin or c:\cygwin64, by default) as the POSIX root, so that c:\cygwin\usr appears as /usr to any program linked to cygwin1.dll which uses POSIX APIs such as open(2). This includes Cygwin's version of GNU bash, as you show.

您不应该在Cygwin终端窗口中需要显式路径,因为/usr/bin 应该在 PATH 中的任何其他内容之前.如果不是这种情况,则可能没有使用 setup.exe 创建的Cygwin图标,在这种情况下,您没有正确的登录外壳.要么使用该图标,要么通过调用 mintty-模仿其功能,而不仅仅是普通的 mintty .

You should not require the explicit path within the Cygwin Terminal window, since /usr/bin should be ahead of anything else in the PATH. If that is not the case, you might not be using the Cygwin icon that setup.exe created, in which case you don't have a proper login shell. Either use that icon, or mimic what it does by calling mintty -, not just plain mintty.

这篇关于用Cygwin制作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆