I use Notepad++ for all my text editing needs, I thought it would be nice to use it as I try to learn C++ with my son who is interested in learning to program for robotics. I have installed MinGW on Win10 and the C:MinGW\bin folder has been added to the system path. I searched the forum and got the following code to put into NppExec to run the c++ compiler and then run the compiled file.npp_savecd "$(CURRENT_DIRECTORY)"g++ "$(FILE_NAME)" -o "$(NAME_PART)"cmd /c "$(NAME_PART)"

Unfortunately, I get the following when I run the script in NppExec:NPP_SAVE: C:\Users\CorrectPathtoCurrentDirectory\CPP-Projects\hello.cppCD: C:\Users\CorrectPathtoCurrentDirectory\CPP-ProjectsCurrent directory: C:\Users\CorrectPathtoCurrentDirectory\CPP-Projectsg++ "hello.cpp" -o "hello"CreateProcess() failed with error code 2:The system cannot find the file specified.cmd /c "hello"Process started >>>'hello' is not recognized as an internal or external command,operable program or batch file.<<< Process finished. (Exit code 1)================ READY ================

I have tested that g++.exe works by opening a powershell in that directory, and running the following command:g++.exe .\hello.cpp -o hello.exe
This compiled the text file into an executable that also worked in powershell. I would appreciate any help in being able to call g++ from within Notepad++ and see the output in the Console of NppExec. Thanks.

]]>https://notepad-plus-plus.org/community/topic/14050/trouble-setting-up-nppexec-to-learn-cRSS for NodeFri, 22 Feb 2019 14:10:28 GMTWed, 28 Jun 2017 18:31:12 GMT60I use Notepad++ for all my text editing needs, I thought it would be nice to use it as I try to learn C++ with my son who is interested in learning to program for robotics. I have installed MinGW on Win10 and the C:MinGW\bin folder has been added to the system path. I searched the forum and got the following code to put into NppExec to run the c++ compiler and then run the compiled file.npp_savecd "$(CURRENT_DIRECTORY)"g++ "$(FILE_NAME)" -o "$(NAME_PART)"cmd /c "$(NAME_PART)"

Unfortunately, I get the following when I run the script in NppExec:NPP_SAVE: C:\Users\CorrectPathtoCurrentDirectory\CPP-Projects\hello.cppCD: C:\Users\CorrectPathtoCurrentDirectory\CPP-ProjectsCurrent directory: C:\Users\CorrectPathtoCurrentDirectory\CPP-Projectsg++ "hello.cpp" -o "hello"CreateProcess() failed with error code 2:The system cannot find the file specified.cmd /c "hello"Process started >>>'hello' is not recognized as an internal or external command,operable program or batch file.<<< Process finished. (Exit code 1)================ READY ================

I have tested that g++.exe works by opening a powershell in that directory, and running the following command:g++.exe .\hello.cpp -o hello.exe
This compiled the text file into an executable that also worked in powershell. I would appreciate any help in being able to call g++ from within Notepad++ and see the output in the Console of NppExec. Thanks.

]]>https://notepad-plus-plus.org/community/topic/14050/trouble-setting-up-nppexec-to-learn-c/2https://notepad-plus-plus.org/community/topic/14050/trouble-setting-up-nppexec-to-learn-c/2Wed, 28 Jun 2017 19:58:07 GMTThank you, Jim Dailey, that did the trick. I see why that worked now that I look at it. I should have considered that. The forum post that I saw seemed to indicate that the original code that I had without the extra cmd /c should have worked. Now I’m off to learn C++ which looks to be a challenge for an old dog.