June 27, 2018

How to use Cygwin + C compiler + Notepad++




On Notepad++, It is possible to compile a C code program. To do it, Follow the below steps.


[Step 1] Install "i686-w64-mingw32-gcc" in Cygwin.
* # apt-cyg install i686-w64-mingw32-gcc
* Be careful. If you install other GCC such as "gcc-core", It can't be executed in windows CMD because it is going to have the dependency on Cygwin DLL file.

[Step 2] Install NppExec plugin at Notepad++.

[Step 3] Make a C code program.

[Step 4] Press execute menu(F6) of NppExec.

[Step 5] Copy and paste the below script and click OK.

npp_save
CD C:\cygwin64\bin\
i686-w64-mingw32-gcc "$(FULL_CURRENT_PATH)" -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe"
npp_run $(CURRENT_DIRECTORY)\$(NAME_PART).exe

โ€ป View all process in the video.