0
我遇到了C Makefile的問題。C Makefile編譯錯誤 - 「鏈接器輸入文件未使用,因爲鏈接沒有完成」
這是在bash的Makefile文件的代碼:
CC=gcc
CFLAGS=-g -Wall
CCLINK=$(CC)
OBJS=flight.o runway.o airport.o main.o
RM=rm -f
# Creating the executable (airport)
airport: $(OBJS)
$(CCLINK) -o airport $(OBJS)
# Creating object files using default rules
main.o: main.c airport.h ex2.h flight.h runway.h
airport.o: airport.c airport.h ex2.h flight.h runway.h
runway.o: runway.c runway.h ex2.h flight.h
flight.o: flight.c flight.h ex2.h
# Cleaning old files before new make
clean:
$(RM) airport *.o *.bak *~ "#"* core
當我把文件,上面說:
make: `airport` is up to date.
之後 - 我稱之爲 「飛機場」,在bash和它讓我以我想要的方式輸入一些輸入。當我試圖檢查「機場」是由編譯
丁:
gcc -g -Wall -c airport
我得到一個錯誤說:
gcc: airport: linker input file unused because linking not done
是否有人知道可能是什麼問題?
謝謝! Gavriel。
你是什麼意思*當我試圖檢查是否「機場」編譯:*? – 2501
嗯,它接縫你試圖編譯你的可執行文件... – Garf365
是的,嘗試'gcc -g -Wall -c airport.c'與**。c **另外,當你發出'gcc'命令,根本不使用makefile *。所以這個問題實際上可能不是關於make。但是我們都在某個時候開始學習這些東西。 * make */* gcc */* ld *之間有區別。祝你好運! :) –