這個指導教學將指示您建立一個標準 Make C++ 專案,這需要建立一個 Make 檔。 受管理的 Make C/C++ 專案會自動產生 Make 檔。
如果要建立 Make 檔,請執行下列動作:
all: hello.exe
clean:
rm main.o hello.exe
hello.exe: main.o
g++ -g -o hello main.o
main.o:
g++ -c -g main.cpp
新的 Make 檔會和 main.cpp 檔一起顯示在「C/C++ 專案」視圖和「導覽器」視圖中。 現在,您的專案包含 main.cpp 和 Make 檔。 現在,您可以開始建置 HelloWorld 專案。