0
我做了一個makefile,我試圖測試,但我在化妝得到一個錯誤:品牌:*** []錯誤1
austins-macbook:work4 staffmember$ make new
rm -f main.o heap.o heap
gcc -Wall -O2 -c -o main.o main.c
gcc -Wall -O2 -c -o heap.o heap.c
heap.c: In function ‘createHeap’:
heap.c:6: warning: implicit declaration of function ‘malloc’
heap.c:6: warning: incompatible implicit declaration of built-in function ‘malloc’
heap.c:8: warning: implicit declaration of function ‘exit’
heap.c:8: warning: incompatible implicit declaration of built-in function ‘exit’
gcc -Wall -O2 -o heap main.o heap.o
austins-macbook:work4 staffmember$ make test
./heap
make: *** [test] Error 1
我認爲越來越讓*錯誤1的意思你的某個組件沒有正確編譯,但是編譯它時沒有任何錯誤消息。我如何找出問題所在?
雖然這與您的問題沒有任何關係,但您可能希望將缺少的'#include'添加到'heap.c'。 – NPE 2013-04-09 06:25:15