把程序拷贝出来执行,缺少的库都用export导入,执行发现广播编码总是错误,非常纳闷。于是用ldd命令查看链接的库,发现libbcch库用的是/usr/lib/下面的,那是早期偷懒拷贝过去的一个库,和现在的程序并不匹配,于是删掉那个库,重新导入就ok了。
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/src$ldd bsmac
linux-vdso.so.1=> (0x00007fff98b9d000)
libbsmac.so.0(0x00007fe4d0818000)
libConf.so.0=> /mnt/hgfs/share/test/sim/jonet1_8_bs_mac/dep/InitConf/.libs/libConf.so.0(0x00007fe4d05f9000)
liblayerPrim.so.0=> /mnt/hgfs/share/test/sim/jonet1_8_bs_mac/dep/protobuf/.libs/liblayerPrim.so.0(0x00007fe4d03cc000)
libbcch.so.0=> /usr/lib/libbcch.so.0 (0x00007fe4d0192000)
libach.so.0=> /mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/ach/.libs/libach.so.0(0x00007fe4cff71000)
libMacCommon.so.0=> /mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/common/libMacCommon.so.0(0x00007fe4cfd6b000)
libstdc++.so.6=> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe4cfa6b000)
libgcc_s.so.1=> /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe4cf854000)
libc.so.6=> /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe4cf494000)
libm.so.6=> /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe4cf198000)
libprotobuf.so.7=> /usr/local/lib/libprotobuf.so.7 (0x00007fe4ceeae000)
/lib64/ld-linux-x86-64.so.2(0x00007fe4d0a3a000)
libpthread.so.0=> /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe4cec91000)
libz.so.1=> /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe4cea79000)
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/src$rm /usr/lib/libbcch.so.0
rm: remove write-protected regular file`/usr/lib/libbcch.so.0'? y
rm: cannot remove `/usr/lib/libbcch.so.0':Permission denied
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/src$sudo rm /usr/lib/libbcch.so.0
[sudo] password for liuguili:
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/src$./bsmac
./bsmac: error while loading sharedlibraries: libbcch.so.0: cannot open shared object file: No such file ordirectory
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/src$cd ../lib/bcch/
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch$pwd
/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch$cd .libs/
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch/.libs$pwd
/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch/.libs
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch/.libs$exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch/.libs
liuguili@ubuntu:/mnt/hgfs/share/test/sim/jonet1_8_bs_mac/lib/bcch/.libs$