DEV Community

Play Button Pause Button
Sergiu Mureşan
Sergiu Mureşan

Posted on

Compile and run C/C++ code using Notepad++

For compiling and running using MinGW:

npp_save
cd "$(CURRENT_DIRECTORY)"
gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)"
"$(NAME_PART).exe"

For compiling and running using Visual C:

npp_save
cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
vcvarsall.bat x64 && cl "$(FULL_CURRENT_PATH)" /Fo$(CURRENT_DIRECTORY)\ /link /out:"$(CURRENT_DIRECTORY)\$(NAME_PART).exe"
cd $(CURRENT_DIRECTORY)
"$(NAME_PART).exe"

More info on Visual C vcvars scripts:
https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019

Top comments (0)