gpt4 book ai didi

c++ - 在 Windows 10 (MinGW) 中使用 gVim 8.1 编译 C/C++

转载 作者:行者123 更新时间:2023-11-28 04:25:18 25 4
gpt4 key购买 nike

因为一切都是 32 位的,我使用了 :set makeprg=mingw32-make,然后尝试通过 :!make 编译,它给出了以下错误信息:

'make' is not recognized as an internal or external command, operable program or batch file.

shell returned 1

我尝试了基本的“再见世界”内容:

#include <iostream>

int main() {
std::cout << "Goodbye World";
return 0;
}

我做错了什么?除了成为菜鸟。

最佳答案

:!make 不运行 'makeprg'。它运行 make。由于您专门尝试运行 mingw32-make.exe,因此您可能没有名为 make.exe 的可执行文件。 (参见 :help :!)

:make 运行 'makeprg'。 (参见 :help :make:help 'makeprg')

my goal is to see the "Goodbye World" either in console or terminal or any observable way. Would this require additional tinkering to the _vimrc file?

您宁愿通过修改您的 makefile 来做到这一点。 :make 的任何参数都将传递给 'makeprg'。如果您定义了目标 clean(以删除 Make 人工制品)或 run(以执行您的 Make 的产品),您将能够编写 :mak clean :mak run 在 Vim 中运行这些目标。显然,您可以创建自己的命令和/或映射以使这些 :make 命令更快。

关于c++ - 在 Windows 10 (MinGW) 中使用 gVim 8.1 编译 C/C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54471850/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com