[root@init1 youshuang]# g++ main.cpp http_conn.cpp -o main
出现如下报错:
main.cpp:(.text._ZN3semC2Ev[_ZN3semC5Ev]+0x1f): 对‘sem_init’未定义的引用
/tmp/cccJr4yJ.o:在函数‘sem::~sem()’中:
main.cpp:(.text._ZN3semD2Ev[_ZN3semD5Ev]+0x14): 对‘sem_destroy’未定义的引用
/tmp/cccJr4yJ.o:在函数‘sem::wait()’中:
main.cpp:(.text._ZN3sem4waitEv[_ZN3sem4waitEv]+0x14): 对‘sem_wait’未定义的引用
/tmp/cccJr4yJ.o:在函数‘sem::post()’中:
main.cpp:(.text._ZN3sem4postEv[_ZN3sem4postEv]+0x14):对‘sem_post’未定义的引用