sqlite 移植

1.下载sqlite-3.6.17.tar.gz 到 /usr/local目录下

2.tar xzvf sqlite-3.6.17.tar.gz 解压
3.mkdir /usr/local/sqlite_x86
4.cd /usr/local/sqlite-3.6.17
5../configure -prefix=/usr/local/sqlite_x86
6.make
7.make install
8.编译文件
   gcc -o test -I /usr/local/sqlite_x86/include -L /usr/local/sqlite_x86/lib test.c -lsqlilte3 -static -lpthread -lm
    gcc 指定编译器
    -o test  输出文件名
    -I /usr/local/sqlite_x86/include 指定头文件路径
    /usr/local/sqlite_x86/lib  指定库文件路径
    test.c                     源文件
    -lsqlilte3 -static -lpthread  指定库名字为libpthread和libsqlite3,且为静态方式编译
以上是安装到x86平台
 3.mkdir /usr/local/sqlite_arm
 4.cd /usr/local/sqlite-3.6.17
 5../configure -prefix=/usr/local/sqlite_arm --disable-tcl --host=arm-linux
 6.make
 7.make install
 8. arm-linux-gcc -o test -I /usr/local/sqlite_arm/include -L /usr/local/sqlite_arm/lib test.c -lsqlilte3 -static -lpthread
 9.把移植库文件libsqlite3.so.0和sqlite3
 10.执行sqlite3时会报错/***: error while loading shared libraries: libsqlite3.so.0: cannot open shared object file: No such file or directory
    解决办法cp libsqlite3.so.0 /lib
   vi /etc/profile 
    把sqlite3的路径放到path路径里
   这样移植就可以了
 
posted @ 2012-06-20 10:46  黑-色-柳—丁  阅读(163)  评论(0编辑  收藏  举报