簡體   English   中英

pthread的Makefile

[英]Makefile for pthreads

我正在嘗試編譯一個pthread示例,但是出現以下錯誤:

make: *** No rule to make target `example.cpp', needed by `example.o'.  Stop.

這是我的makefile:

CC = g++
CCFLAGS = -Wall

example: example.o
        $(CC) $(CCFLAGS) -o example example.o -pthread

example.o: example.cpp
        $(CC) $(CCFLAGS) -c example.cpp -pthread

clean:
        - rm *.o
        - rm example

我包含了-pthread標志,我不確定它還需要什么才能進行編譯。 有人有想法么? 非常感謝你。

如此說來,當前目錄中沒有example.cpp。

在當前目錄中執行ls並在此處發布。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM