cc1已停止工作[在记事本中编译并执行++]

发布于 2024-10-19 11:56:35 字数 1437 浏览 2 评论 0原文

我正在尝试使用记事本++编译和执行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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜无邪 2024-10-26 11:56:35

您需要保护(转义或引用)反斜杠。请注意输出中如何缺少冒号(反斜杠后面的字符),这就是您的提示。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文