sqlite3 cross compile

1. To cross-compile sqllite3, you can first download the latest source code from the official website and compile it. sqlite3 download sqlite3 has two versions of the source code, sqlite-amalgamation-3420000.zip This is to put all the operations in sqlite3 for use. Although it is officially recommended to use this method. However, for embedded transplantation, it is more convenient to use sqlite-autoconf-3420000.tar.gz to automatically configure and compile it into an so library.
sqlite3 official website download URL: https://www.sqlite.org/download.html
2. First use tar xzvf sqlite-autoconf-3420000.tar.gz to decompress the source code.
3. Enter the directory after decompression.
4. Run configure to configure, the following three configuration methods, the first one does not need to write the cross compiler into the environment variable, and the other two need to write the cross compilation chain into the environment variable

./configure CC=/opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/bin/arm-hisiv500-linux-gcc --host=arm-linux --prefix= /usr/tmp/
./configure CC=arm-hisiv500-linux-gcc --host=arm-linux --prefix= /usr/tmp/
./configure CC=arm-hisiv500-linux-gcc --host=arm-linux --prefix=/opt/linuxsir/projects/sqlite-autoconf-3420000/install

Note: CC assignment is the cross-compilation tool used in the embedded development environment, --host specifies that the software operating environment is arm-linux, --prefix specifies the path of the generated file after cross-compiling the source code.
5. Use makeand make installinstall the compiled sqlite3dynamic library.
insert image description here

6. Copy the three so files libsqlite3.so libsqlite3.so.0 libsqlite3.so.0.8.6 generated in the /install directory, the /lib/ directory of the embedded development environment or the lib directory that the program runs on. Can.
Copy the sqlite3 application in the install directory to the embedded development environment to run and create a database.
After compiling with the virtual machine, when copying these files to windows, the VM virtual machine does not allow copying and reports an error. In this way, these libraries can be compressed into a compressed package, and all can be copied directly.
You can also use the static library directly
insert image description here

おすすめ

転載: blog.csdn.net/qq_40170041/article/details/131658350