linux 编译lpthread

1:undefined reference to `pthread_create'

gcc main.c -o test -lpthread

[root@hqgao ddserver]# gcc ddserver.c -o ddserver -lpthread

[root@hqgao ddserver]# ./ddserver

Segmentation fault

makefile

简单例子

all: httpd client

LIBS = -lpthread #-lsocket

httpd: httpd.c

gcc -g -W -Wall $(LIBS) -o $@ $

client: simpleclient.c

gcc -W -Wall -o $@ $

clean:

rm httpd

你可能感兴趣的:(linux,运维,服务器)