当需要多线程编程时,需要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
本文介绍了解决多线程编程中遇到的libpthread.so.0依赖缺失问题的方法。通过在Makefile文件中添加相应的配置,确保了gctTest_server能够正确链接到pthread库。





