DEV Community

0 seconds of 10 minutes, 33 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
10:33
 
Sergiu Mureşan
Sergiu Mureşan

Posted on

8 4

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)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay