当需要多线程编程时,需要thread库支持,否则编译时出现如下错误:
PackagegctTest_server is missing dependencies for the following libraries:
libpthread.so.0
解决方法:在上级目录(package目录下)的Makefile中添加一句话:
definePackage/gctTest_server
SECTION:=xxxx
CATEGORY:=xxxx
TITLE:=gctTest_server for eg7035
DEPENDS:=+libpthread
endef
在源码Makefile中添加
gctTest_server:$(FLASH_OBJS)
$(CC) -o $@ $(FLASH_OBJS) -lpthread