我使用MinGW和試圖建立一個使用Makefile證明可執行文件,但它給了我下面的錯誤GCC:說到這個如此Makefile文件上對C
Directory of C:\Users\PATTY\Desktop\loops
08/19/2016 01:34 PM <DIR> .
08/19/2016 01:34 PM <DIR> ..
08/18/2016 10:41 PM 59,628 a.exe
08/18/2016 11:58 PM 261 demo.c
08/18/2016 11:59 PM 59,541 demo.exe
08/18/2016 07:01 PM 605 justify.c
08/18/2016 07:01 PM 1,122 line.c
08/18/2016 07:02 PM 197 line.h
08/19/2016 01:03 AM 350 newquote.txt
08/18/2016 11:05 PM 628 planets.c
08/18/2016 11:14 PM 60,139 planets.exe
07/15/2016 08:03 PM 89 pun.c
08/19/2016 12:55 AM 412 quote.txt
08/13/2016 05:32 PM 167 reverse.c
08/18/2016 10:45 PM 28,107 reverse.exe
08/18/2016 10:45 PM 708 reverse.o
08/19/2016 03:14 AM 459 something.txt
08/11/2016 11:14 PM 1,698 test.c
08/18/2016 07:01 PM 427 word.c
08/18/2016 07:02 PM 92 word.h
18 File(s) 214,630 bytes
2 Dir(s) 164,884,508,672 bytes free
C:\Users\PATTY\Desktop\loops>mingw32-make justify
cc justify.c -o justify
process_begin: CreateProcess(NULL, cc justify.c -o justify, ...) failed.
make (e=2): The system cannot find the file specified.
<builtin>: recipe for target 'justify' failed
mingw32-make: *** [justify] Error 2
C:\Users\PATTY\Desktop\loops>
我是初學者,請讓我知道我錯過了什麼或做錯了什麼。
編輯:
另一個失敗的嘗試:
C:\Users\PATTY\Desktop\loops>mingw32-make justify CC=gcc
gcc justify.c -o justify
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x10): undefined reference to `clear_line'
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x24): undefined reference to `read_word'
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x40): undefined reference to `flush_line'
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x5f): undefined reference to `space_remainding'
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x68): undefined reference to `write_line'
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x6d): undefined reference to `clear_line'
C:\Users\PATTY\AppData\Local\Temp\cc2z2lvl.o:justify.c:(.text+0x79): undefined reference to `add_word'
collect2.exe: error: ld returned 1 exit status
<builtin>: recipe for target 'justify' failed
mingw32-make: *** [justify] Error 1
C:\Users\PATTY\Desktop\loops>
圖片的問題是沒用的。您的代碼和錯誤消息是文本。剪切/粘貼到你的問題。 –
我只是不知道如何複製/粘貼打印在cmd提示符上的文本 – tadm123
將包含mingw-make.exe的文件夾添加到Path環境變量中,關閉終端,再次打開並重試。 – Tim