cc1已停止工作[在记事本中编译并执行++]
我正在尝试使用记事本++编译和执行C代码。
下面是我用于 NppExec 的脚本。
NPP_SAVE
SET GCC = C:\cygwin\bin\gcc.exe
SET OBJ = $(CURRENT_DIRECTORY)\$(NAME_PART)
"$(GCC)" -c "$(FULL_CURRENT_PATH)" -o "$(OBJ).o"
"$(GCC)" "$(OBJ).o" -o "$(OBJ).exe"
"$(OBJ).exe"
UNSET OBJ
UNSET GCC
当我使用 F6 执行上述脚本时。我收到以下消息。
# NPP_EXEC: "C_compile_execute"
# NPP_SAVE: E:\Cprograms\test.c
# SET: GCC = C:\cygwin\bin\gcc.exe
# $(GCC) = C:\cygwin\bin\gcc.exe
# SET: OBJ = E:\Cprograms\test
# $(OBJ) = E:\Cprograms\test
# "C:\cygwin\bin\gcc.exe" -c "E:\Cprograms\test.c" -o "E:\Cprograms\test.o"
# Process started >>>
# <<< Process finished.
# "C:\cygwin\bin\gcc.exe" "E:\Cprograms\test.o" -o "E:\Cprograms\test.exe"
# Process started >>>
# gcc: E:\Cprograms\test.o: No such file or directory
# gcc: no input files
# <<< Process finished.
# "E:\Cprograms\test.exe"
# CreateProcess() failed with error code 2:
# The system cannot find the file specified.
# - the user's variable has been removed: $(OBJ)
# - the user's variable has been removed: $(GCC)
# ================ READY ================
我在弹出窗口中收到一个错误,例如:“cc1 已停止工作”
但是,我可以从命令行成功编译和执行。
E:\Cprograms>C:\cygwin/bin/gcc.exe test.c -o test.exe
E:\Cprograms>test.exe
Hello
E:\Cprograms>
我使用的是 Windows Vista。
请指导我如何解决这个问题。
I am trying to compile and execute c code using notepad++.
Below is the script i am using for NppExec.
NPP_SAVE
SET GCC = C:\cygwin\bin\gcc.exe
SET OBJ = $(CURRENT_DIRECTORY)\$(NAME_PART)
"$(GCC)" -c "$(FULL_CURRENT_PATH)" -o "$(OBJ).o"
"$(GCC)" "$(OBJ).o" -o "$(OBJ).exe"
"$(OBJ).exe"
UNSET OBJ
UNSET GCC
when I execute above script using F6. I get below messages.
# NPP_EXEC: "C_compile_execute"
# NPP_SAVE: E:\Cprograms\test.c
# SET: GCC = C:\cygwin\bin\gcc.exe
# $(GCC) = C:\cygwin\bin\gcc.exe
# SET: OBJ = E:\Cprograms\test
# $(OBJ) = E:\Cprograms\test
# "C:\cygwin\bin\gcc.exe" -c "E:\Cprograms\test.c" -o "E:\Cprograms\test.o"
# Process started >>>
# <<< Process finished.
# "C:\cygwin\bin\gcc.exe" "E:\Cprograms\test.o" -o "E:\Cprograms\test.exe"
# Process started >>>
# gcc: E:\Cprograms\test.o: No such file or directory
# gcc: no input files
# <<< Process finished.
# "E:\Cprograms\test.exe"
# CreateProcess() failed with error code 2:
# The system cannot find the file specified.
# - the user's variable has been removed: $(OBJ)
# - the user's variable has been removed: $(GCC)
# ================ READY ================
And I got a error in popup window like: "cc1 has stopped working"
However, I can compile and execute from commandline successfully.
E:\Cprograms>C:\cygwin/bin/gcc.exe test.c -o test.exe
E:\Cprograms>test.exe
Hello
E:\Cprograms>
I am using Windows Vista.
Please guide me on how I can I solve this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要保护(转义或引用)反斜杠。请注意输出中如何缺少冒号(反斜杠后面的字符),这就是您的提示。
You need to protect (escape or quote) the backslashes. Notice how the colon (the character after the backslash) is missing in the output, that's your hint.