系统相关
首页 > 系统相关> > linux 下uci纯净版 编译

linux 下uci纯净版 编译

作者:互联网

搭建环境:在我的电脑上的64位虚拟机下
Compiling UCI as stand alone

一、编译uci库
cd ~

cd /wyy/work/ft100/GNS/uci_gns/uci


cd ~/uci

cmake -DBUILD_LUA=off

sudo make install

或make install DESTDIR=$HOME(为了能够安装到标准路径下,方便其他程序也可以调用uci库,此处选择sudo mak install安装到根目录下)

此时会提示出错,

 
二、编译ubox库
进入

/wyy/work/ft100/GNS/uci_gns/libubox


cd ~/libubox

cmake -DBUILD_LUA=off

sudo make install

 

返回uci目录继续安装

cd ~/uci

sudo make install

三、处理错误
此时执行uci -v命令会提示
uci: error while loading shared libraries: libuci.so: cannot open shared object file: No such file or directory
解决办法:用软连接连接上
linux@ubuntu:/usr/local/lib$ ldd /usr/local/bin/uci

         linux-gate.so.1 =>  (0xb779f000)

         libuci.so => not found

         libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb75e7000)

         /lib/ld-linux.so.2 (0xb77a0000)
 sudo ln -s /usr/local/lib/libuci.so /usr/lib/libuci.so

linux@ubuntu:/usr/local/lib$ ldd /usr/local/bin/uci

         linux-gate.so.1 =>  (0xb7776000)

         libuci.so => /usr/lib/libuci.so (0xb7757000)

         libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb75b2000)

         libubox.so => /usr/lib/libubox.so (0xb75a7000)

         /lib/ld-linux.so.2 (0xb7777000)

         librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb759e000)

         libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7583000)

linux@ubuntu:/usr/local/lib$ ldd /usr/local/bin/uci

更新ldconfig

sudo /sbin/ldconfig -v

OK

标签:lib,编译,so,usr,linux,local,uci
来源: https://www.cnblogs.com/rungirl/p/12456203.html