Notepad++ NppExec console warning, need explanation "C++"

391 Views Asked by At

I've tried using Notepad++ to code c++ and followed a few tutorials on youtube, here's what I did:

-Installed gcc/g++ compiler using mingw64

-Installed NppExec plugin on N++

-Typed in the following compilier script and saved as C++:

NPP_SAVE cd
$(CURRENT_DIRECTORY)
g++ $(FILE_NAME)
cmd /c $(CURRENT_DIRECTORY)\program.exe

Anyways whenever compiling a program, for example a simple program

#include <iostream>
using namespace std;
int main(){
    cout << "Online\n";
    system("pause"); //So that cmd doesn't disappear immeadiately on running.
    return 0;
}

The console displays the following warning:
"C:\Users\pc\Desktop\Courses\Projects\C\program.exe' is not recognized as an internal or external command, operable program or batch file."
My question is,
When I run the program on cmd, it runs perfectly but the error displayed during linking says that the folder does not exist in %PATH%
Any explanation?
Thank you!

1

There are 1 best solutions below

0
Khaled On

Ok so, what I basically did was change the script,

cmd /c $(CURRENT_DIRECTORY)\program.exe

To be later

cmd /c $(CURRENT_DIRECTORY)\a.exe

the console worked fine and even received input

Here is a link to a similar problem:

How to compile/execute C++ code from within Notepad++