Notepad ++,NppExec,CreateProcess()失败,错误代码2,Windows 10

时间:2020-05-01 05:08:35

标签: c notepad++ nppexec

嗨,我是C编程和Notepad ++的新手。在为Windows 10配置C编译器时,似乎找不到解决此问题的方法。

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 ================

我从https://www.youtube.com/watch?v=_dGyVkPkBRI&t=88s取来的NppExec脚本

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

请提供帮助,谢谢。

1 个答案:

答案 0 :(得分:0)

恐怕这行不通。据我所知,您正在尝试编译文件change.log,该文件几乎可以肯定不是C模块(或者gcc可能理解的其他任何内容。

请重新检查发布的脚本中的FULL_CURRENT_PATH变量。我认为youtube片段(我没看过)或您尝试复制它的方式存在误解。


此外,此类脚本不再是使程序构建和执行自动化的理想解决方案。您应该检查更好的替代方案,例如IDE(Eclipse,Netbeans,Visual Studio或您喜欢的任何东西),或者学习编写自己的Makefile(检查GNU Make工具),它比cmd功能强大得多。脚本。

PS:Notepad ++是一个不错的编辑器,但它不是IDE。一旦您正在编写由多个模块和/或头文件组成的软件,就想快速浏览这些内容,以免出错。

相关问题