首先找交叉编译工具( toolchain )

Development Snapshots

http://downloads.openwrt.org/snapshots/trunk/

我需要的版本是 m7620

http://downloads.openwrt.org/snapshots/trunk/ramips/mt7620/

下载文件  OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2

[root@VM_129_51_centos openwrt]# wget http://downloads.openwrt.org/snapshots/trunk/ramips/mt7620/OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# tar -jxf OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1..Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# mv OpenWrt-Toolchain-ramips-mt7620_gcc-5.3.0_musl-1.1..Linux-x86_64 toolchain
[root@VM_129_51_centos openwrt]# wget http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7620/OpenWrt-SDK-15.05.1-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# tar -jxf OpenWrt-SDK-15.05.-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
[root@VM_129_51_centos openwrt]# mv OpenWrt-SDK-15.05.1-ramips-mt7620_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64 SDK
[root@VM_129_51_centos openwrt]# find / -name staging_dir
/root/openwrt/SDK/staging_dir
[root@VM_129_51_centos bin]# export STAGING_DIR='/root/openwrt/SDK/staging_dir'
[root@VM_129_51_centos bin]# export CC=/root/openwrt/toolchain/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1./bin/mipsel-openwrt-linux-musl-g++
[root@VM_129_51_centos bin]# export CPLUS_INCLUDE_PATH=/root/openwrt/SDK/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/linux-3.18.23/include/uapi/linux/can/
[root@VM_129_51_centos bin]# export LD_FLAGS=-L/root/openwrt/toolchain/toolchain-mipsel_24kec+dsp_gcc-5.3.0_musl-1.1.15/lib/  -static-libstdc++ -static-libgcc -lgcc_s
-static-libstdc++ -static-libgcc

两个选项必须同时使用。相关的介绍请参照:http://blog.csdn.net/kissnsms/article/details/17142149

交叉工具链没有ldd,因此无法查找库依赖关系,可以用以下替代解决方案

readelf -a filename|grep "Shared library"

openwrt 编译newifi 应用程序的更多相关文章

  1. 使用VS+VisualGDB编译调试Linux程序

    Linux程序开发变得越来越多,越来越多的程序.产品需要跨平台,甚至有些开源项目只支持Linux平台,所以掌握Linux开发变得越来越重要. 但是对于习惯了Windows下的开发,使用了VS这个宇宙第 ...

  2. openwrt编译环境搭建

    1,首先安装ubuntu系统,这里安装的是虚拟机 2,安装openwrt编译所需环境  apt-get install build-essential libncures5-dev gawk libs ...

  3. 如何编译ReactNative示例程序Examples

    通过示例程序可以看到一些基本组件的使用,对于学习ReactNative是很有帮助的. 编译示例程序需要将整个项目导入到androidStudio中,androidStudio导入项目时选择react- ...

  4. Ubuntu编译源码程序依赖查找方法

    ubuntu平时编译源码程序的时候会提示缺少相关的库或是头文件,可以按照以下两种方法进行查找,然后再安装相应的软件包. 1.使用apt-file查找头文件 安装apt-file sudo apt-ge ...

  5. VS2010 win7 QT4.8.0,实现VS2010编译调试Qt程序,QtCreator静态发布程序

    下载源代码,注意一定是源码压缩包如qt-everywhere-opensource-src-4.8.0.zip, 不是Qt发布的已编译的不同版本的标准库如qt-win-opensource-4.8.0 ...

  6. 运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory

    运行编译后的程序报错  error while loading shared libraries: lib*.so: cannot open shared object file: No such f ...

  7. 减小Delphi XE5编译出来的程序体积

    默认Delphi XE, XE2, XE3,XE4,XE5, XE6 ... 编译出来的程序体积很大. 一般用两个方法可以很大程度上减少程序体积. 一.在工程中用编译指令禁用RTTI 禁用的方法很简单 ...

  8. linux终端下 编译c语言程序

    linux终端下,编译C语言程序步骤为: 采用vi进行源代码编写,编写完成后,:wq存盘退出,如: vi test.c 在命令行下,运行gcc编译程序,生成执行码,如: gcc  -o test te ...

  9. VS编译的QT程序发布时产生的AppCrash问题

    至少我碰到了三个情况,都是AppCrash错误(以下都指VS2008的Release的设置) 第1个错误,报错模块是程序自己 我使用VS2008 Team with SP1和QT4.86编译程序,一直 ...

随机推荐

  1. 配置SQL Server去使用 Windows的 Large-Page/Huge-Page allocations

    配置SQL Server去使用 Windows的 Large-Page/Huge-Page  allocations 目录表->页表->物理内存页 看这篇文章之前可以先看一下下面这篇文章 ...

  2. libqrencode 3.4.3 发布,二维码的C解析库

    libqrencode 3.4.3 的命令行增加了 --rle 参数,修复了开发库和命令行工具的一些小 bug. libqrencode (QRencode) 是一个用C语言编写的用来解析二维条形码( ...

  3. centos6.4 无法进入图形界面的问题及解决

    在安装了ngnix及pcre.openssl.zlib.lua等模块之后,进不了图形界面. 解决的方法如下: Ctrl+Alt+F5,输入账号和密码 vim /etc/inittab #将等级5改为等 ...

  4. 深入浅出话VC++(2)——MFC的本质

    一.引言 上一专题中,纯手动地完成了一个Windows应用程序,然而,在实际开发中,我们大多数都是使用已有的类库来开发Windows应用程序.MFC(Microsoft Foundation Clas ...

  5. 【Android UI设计与开发】9:滑动菜单栏(一)开源项目SlidingMenu的使用和示例

    一.SlidingMenu简介 相信大家对SlidingMenu都不陌生了,它是一种比较新的设置界面或配置界面的效果,在主界面左滑或者右滑出现设置界面效果,能方便的进行各种操作.很多优秀的应用都采用了 ...

  6. [ACM_模拟] ZOJ 3713 [In 7-bit 特殊输出规则 7bits 16进制]

    Very often, especially in programming contests, we treat a sequence of non-whitespace characters as ...

  7. Java-基础练习2

    1.利用文本编辑器输入课堂上练习的Hello.java,并在JDK环境下编译和运行.请将程序编译.运行的结果截图,填入下框中. class Hello{ public static void main ...

  8. Atitit.java expression fsm 表达式分词fsm引擎

    Atitit.java expression fsm 表达式分词fsm引擎 C:\0workspace\AtiPlatf_cms\src\com\attilax\fsm\JavaExpFsm.java ...

  9. atitit.设计模式(2) -----查表模式/ command 总结

    atitit.设计模式(2) -----查表模式/ command 总结 1. 应用场景: 1 1. 取代一瓦if else 1 2. 建设api rpc风格的时候儿. 1 3. 菜单是Command ...

  10. Linux 常用命令小结

    学习脚本几天了,总结下linux debian下脚本常用命令. Linux    1.添加删除账户 useradd / userdel    2.修改"张三"密码 passwd 张 ...