0

Hi I'm new to C Programming and Notepad++. I can't seem to find the solution to this problem when I was configuring C compiler for Windows 10.

NPP_SAVE: C:\Program Files\Notepad++\change.log
CD: C:\Program Files\Notepad++
Current directory: C:\Program Files\Notepad++
gcc -o "change.exe" "C:\Program Files\Notepad++\change.log"
Process started (PID=16420) >>>
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file change.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
<<< Process finished (PID=16420). (Exit code 1)
"change.exe"
; about to start a child process: ""change.exe""
CreateProcess() failed with error code 2:
The system cannot find the file specified.

================ READY ================

The NppExec script I have taken from https://www.youtube.com/watch?v=_dGyVkPkBRI&t=88s

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

Please help advice, thank you.

rici
  • 234,347
  • 28
  • 237
  • 341
lee lee
  • 11
  • 1

1 Answers1

0

I'm afraid this cannot work. As far as I see, you are trying to compile the file change.log, which is almost certainly not a C module (or anything else gcc might understand.

Please re-check the FULL_CURRENT_PATH variable in the script you posted. I think there is a misunderstanding in the youtube clip (which I didn't watch), or in the way you tried to reproduce it.


Additionally, such scripts are not an ideal solution to automate the program build and execution any more. You should check out better alternatives such as an IDE (Eclipse, Netbeans, Visual Studio or whatever you prefer...), or learn to write yourself a Makefile (check out the GNU Make tool), which is much more powerful than a cmd script.

PS: Notepad++ is a nice editor, but it isn't an IDE. As soon as you are programming software that consists of several modules and/or header files, you want to surf through these efficiently in order to avoid mistakes.

HelpingHand
  • 1,294
  • 11
  • 27
  • You're welcome! If the answer solved the problem, please [accept](https://stackoverflow.com/help/accepted-answer) it and consider [upvoting](https://stackoverflow.com/help/why-vote) it. – HelpingHand May 01 '20 at 13:11