转载原地址:http://www.phpfans.net/article/htmls/200908/Mjc2Nzk1.html
1.先创建一个目录用来保存生成的库和头文件。
mkdir /root/sip2.交叉编译libosip2-3.3.0
./configure --prefix=root/sip --disable-trace --disable-debug --host=arm-linux
如果要在Linux下编译 --host这个选项去掉即可 默认
make
make install
3.交叉编译libeXosip2-3.3.0
./configure --prefix=/root/sip --host=arm-linux --target=arm-linux --disable-static --disable-manual --with-osip=/root/sip
配置打印信息,一定要配置prefix的路径,一定要和编译ibosip2-3.3.0的--prefix=root/sip一样否则会提示找不到头文件
checking pkg-config is at least version 0.9.0... yes
checking for OSIP... no
configure: WARNING: assuming osip can be found in -I${prefix}/include and -L${exec_prefix}/lib
checking whether -Wall works... yes
make install
4.生成的库和头文件在/home/XX/josua目录下,将库文件拷贝到开发板/lib目录下即可.
5.应用程序的编译
将源代码放在/root/sip目录下如hello.c
arm-linux-gcc hello.c -o hello -I ./include -L ./lib -leXosip2 -lpthread
不行就将lib目录下的动态库拷贝到交叉编译工具链下面的arm-linux/lib目录下。