2047 views|3 replies

164

Posts

0

Resources
The OP
 

Xunwei IMX6 development board QT system Sqlite3 transplantation and use [Copy link]

This chapter introduces how to port sqlite3 to the ARM development board and operate sqlite3 in C language on the development board. The relevant supporting materials are in the online disk "iTOP-i.MX6 development board information summary (excluding CD information)\08_iTOP-i.MX6 development board Linux system development information\25-QT system Sqlite3 porting and use" directory. Operation source code download address:

We directly download the latest version (version 3.32.3), and we put the downloaded compressed package under the document directory:

1 Unzip the downloaded compressed package sqlite-autoconf-3320300.tar.gz and create the installation directory mkdir install, as shown in the figure below:

2 Enter the unzipped directory and configure the compilation options: ./configure --host=arm-none-linux-gnueabi
--prefix=/home/topeet/iMX6Q/sqlite3/install/ .
--host: Specifies the cross-compilation tool, which is the same as the compiler for compiling Linux.
--prefix: specifies the installation directory. The files generated after compilation are placed in this directory. It must be an absolute path.

3 Execute make. After completion, it will be as shown in the following figure:

3 Execute make. After completion, it will be as shown in the following figure:

5 Check whether the required files are generated in the install directory.

6 Copy the library files in the lib directory to the /lib/ directory of the development board, and copy the sqlite3 in the bin directory to the /bin/ directory of the development board.
7 Enter sqlite3 in the terminal command line of the development board, and the following figure will be displayed:

8 Test:
1 Create a new table, enter create table user (id int, name char, age int); Then query the table, enter .table, and you can find the user table you just created, as shown in Figure 83.9:

2 Create a .db file
Enter sqlite3 /path/filename.db Be sure to enter .databases after the operation.

3 Write C code test:
Now create a table in the database and insert data:
create table demo (id int,name char,age int);
insert into demo values(100,'WangWu',23);
insert into demo values(101,'Tommm',25);
select * from demo;

The C code is as follows. For details, please refer to the demo source code in the directory.

Enter the following command to cross-compile: arm-none-linux-gnueabi-gcc -I/home/topeet/iMX6Q/sqlite3/install/include/ -L /home/topeet/iMX6Q/sqlite3/install/lib/ -o sql
testSql.c -lsqlite3 -ldl
-I specifies the path where sqlite3.h is located, and
-L specifies the lib library path of sqlite3.

Copy the generated executable file sql to the root directory of the development board
After execution, you can see the query results:

This concludes the introduction to the porting and simple use of sqlite3. Xunwei IMX6Q development board

This post is from ARM Technology

Latest reply

SQLite is already a standard feature in iOS.   Details Published on 2021-3-18 23:16
 

6555

Posts

0

Resources
2
 

I really didn't see the picture.

This post is from ARM Technology
 
 
 

1w

Posts

204

Resources
3
 

Didn't see the picture~~

This post is from ARM Technology
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 

7422

Posts

2

Resources
4
 

SQLite is already a standard feature in iOS.

This post is from ARM Technology
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list