sqlite3编译

时间:2024-01-02 18:46:26

1.sqlite3编译:
1.PC版:
1.解压:
tar xvf sqlite-autoconf-3140100.tar.gz
cd sqlite-autoconf-3140100/
2.检查配置
sudo apt-get install libreadline-dev
./configure --prefix=/usr/local/sqlite3/PC
3.make
4.sudo make install

5.检查确认是否编译成功:
cd /usr/local/sqlite3/PC/bin
./sqlite3 -version
显示结果如下:
3.14.1 2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b

2.ARM版:

0.rm sqlite-autoconf-3140100/ -rf
1.解压
tar xvf sqlite-autoconf-3140100.tar.gz
2.检查配置:
cd sqlite-autoconf-3140100/
./configure --prefix=/usr/local/sqlite3/ARM --host=arm-linux
3.make
4.sudo make install
5.检查确认是否编译成功:
cd /usr/local/sqlite3/ARM/bin
file ./sqlite3
显示如下:
./sqlite3: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

注:如果make install出现如下错误:
./libtool: line 1720: arm-linux-ranlib: command not found
make[1]: *** [install-libLTLIBRARIES] Error 127
解决方法:
sudo -s
export PATH=$PATH:/usr/local/arm/arm-2009q3/bin
make install
操件完成后退出root用户
exit

6.把bin目录和lib目录打包、下载到开发板
cd /usr/local/sqlite3/ARM/
sudo tar zcvf libsqlite3.tar.gz bin lib
cp libsqlite3.tar.gz ~/tftp
建议下载到开发板的home目录,不要放在根目录下
打开开发板:
cd /home
tftp -gr libsqlite3.tar.gz 192.168.1.XX
tar xvf libsqlite3.tar.gz
把bin目录下的sqlite3 拷贝到 /bin
cp bin/sqlite3 /bin
把lib目录下的libsqlite3* 拷贝到/lib
cp lib/libsqlite3* /lib