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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay