2011-02-28 34 views
0

我正在嘗試使用notepad ++編譯並執行c代碼。cc1已停止工作[編譯並在記事本++中執行]

下面是我用於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。

請指導我如何解決這個問題。

回答

2

您需要保護(轉義或引用)反斜槓。注意輸出中冒號(反斜槓後面的字符)缺失,這就是你的提示。