所以我写了一个程序在运行OpenWrt Attitude Adjustment 12.09的Tp-link设备上运行。
我在/OpenWrt-SDK../package/myprogram/src/Makefile 中成功编写了 makefile,当我执行“make”时,一切运行顺利。
现在我在我的程序中添加了线程,所以我这样配置 Makefile:
# build myprogram executable when user executes "make"
LDFLAGS=-pthread
myprogram: myprogram.o
$(CC) $(LDFLAGS) myprogram.o -o myprogram
myprogram.o: myprogram.c
$(CC) $(CFLAGS) -c myprogram.c
# remove object files and executable when user executes "make clean"
clean:
rm *.o myprogram
当我在 package/myprogram/src 文件夹中“制作”时,它编译成功并在我的 PC 上运行良好。
现在,当我转到 OpenWrt-SDK 根目录进行“制作”时,我收到了一个缺少依赖项的错误:
Package myprogram is missing dependencies for the following libraries:
libpthread.so.0
那么我需要做什么来包含这些依赖项呢?
我转到我的 OpenWrt-SDK 根目录并尝试:
./scripts/feeds search libpthread
我得到了这个结果:
./scripts/feeds search libpthread
Search results in feed 'trunk':
libpthread POSIX thread library
我应该安装它还是不安装它?我不知道我是否做错了什么。
我将不胜感激任何帮助! 谢谢。
最佳答案
在包定义下添加
DEPENDS:=+libpthread
关于c - OpenWrt SDK自定义包 'make'失败,因为缺少libpthread.so.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17321653/