使用 minGW 创建 Gnu MP 库:"Nothing to be done for Makefile.in"

Make Gnu MP library with minGW: "Nothing to be done for Makefile.in"

我想在 Windows 上使用 GMP (https://gmplib.org/),所以我下载了名为 gmp-6.1.0 的文件夹并尝试在其上使用 mingw32-make.exe。它打印: "mingw32-make: *** No targets specified and no makefile found. Stop." 但文件夹中有一个 Makefile.in 。当我尝试 "mingw32.exe Makefile.in" 它打印出 "Nothing to be done for Makefile.in".

我真的不知道在这里做什么,因为这里有一个人:How to compile makefile using MinGW? 说我只需要 mingw32.exe makefile.in

要安装 GMP,您应该:
1. 安装 MSYS 或 Cygwin(至少有 Autotools 包和 make 工具)
2. 运行 "./configure" 命令生成makefile,简称为"makefile"
3. 运行 "make" 命令构建
4. 运行 "make install" 安装GMP

因此,如果您使用 VscodeMingw 那么您应该首先确保Mingw 包含在环境 path 中,最好将 mingw32-make.exe 更改为 make 以简化任务,然后创建一个 makefile 并将此代码包含在其中 .

all:
    gcc -o filename filename.c
    ./filename

然后保存makefile并打开VscodeCode终端写入make。然后makefile将被执行。