让Notepad ++使用minGW编译和运行C++程序

San*_*ofa 5 c++ mingw notepad++

我在Notepad ++的控制台中使用gcc命令下载了minGW来编译C程序.我下载了所有的软件包,以便它可以编译其他语言,我再次检查我有g ++.exe,就像我有gcc.exe来编译c程序一样.但我不知道如何编译和运行c ++程序.我看到另一篇文章"让编译器在记事本中工作",以及他如何复制和粘贴:

NPP_SAVE
CD $(CURRENT_DIRECTORY)
C:\MinGW\bin\g++.exe -g "$(FILE_NAME)"
Run Code Online (Sandbox Code Playgroud)

进入nppExec控制台.当我这样做时,我得到:

NPP_SAVE: C:\Tutorial\helloWorld.cpp
CD: C:\Tutorial
Current directory: C:\Tutorial
C:\MinGW\bin\g++.exe -g "helloWorld.cpp"
Process started >>>
<<< Process finished. (Exit code 0)
================ READY ================
Run Code Online (Sandbox Code Playgroud)

看起来它有用,但我接下来该怎么办?

这是记事本++中的程序

#include <iostream> 

using namespace std; 

int main() {

cout << "Hello World";

}
Run Code Online (Sandbox Code Playgroud)

Gáb*_*yal 6

说实话,我之前没有尝试过nppExec插件.(我通常使用IDE.)但这是一个有根据的猜测:

您键入的内容使代码编译,但未执行生成的可执行文件.您需要指定输出文件,然后运行它.它会是这样的:

NPP_SAVE
CD $(CURRENT_DIRECTORY)
C:\MinGW\bin\g++.exe -g "$(FILE_NAME)" -o prog.exe
prog.exe
Run Code Online (Sandbox Code Playgroud)