pthread编译选项(命令行,codeblocks)
通过命令行编译:
For Linux the correct command is:
gcc -pthread -o term term.c
In general, libraries should follow sources and objects on command line, and -lpthread
is not an "option", it's a library specification. On a system with only libpthread.a
installed,
gcc -lpthread ...
will fail to link.
通过codeblocks编译:
settings->compiler->linker settings->other link options 写 -pthread
posted on 2018-03-13 21:10 CreatorKou 阅读(368) 评论(0) 编辑 收藏 举报