Kat*_*Mak 2 c c++ linux makefile pthreads
我正在尝试编译一个pthread示例,但我收到以下错误:
make: *** No rule to make target `example.cpp', needed by `example.o'. Stop.
Run Code Online (Sandbox Code Playgroud)
这是我的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
Run Code Online (Sandbox Code Playgroud)
我包含了-pthread标志,我不确定它还需要什么才能编译.有人有主意吗?非常感谢你.
| 归档时间: |
|
| 查看次数: |
9225 次 |
| 最近记录: |