所以我写了一个程序在一个运行OpenWrt姿态调整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文件夹中“make”时,它会成功编译并在我的电脑上运行良好。
现在,当我转到根OpenWrt SDK目录“make”时,会得到一个缺少依赖项的错误:
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