Configure sqlite3 under linux--all open source code environment configuration nanny-level tutorial wall crack recommendation

Configure sqlite under linux-recommended for all open source code environments

About sqlite3

sqlite is a kind of portable database, applicable to all platforms on the market, and easy to operate, the key is that it is open source and free, just ask you if it is not popular for prostitution?
There are also databases in the same period: sqlserver, open source and free, but mainly used under windows. The mysql database is too big to be suitable for some embedded systems. In summary, the advantages of sqlite are obvious

About configuration

First of all, about open source, explain what is called open source. Open source, as the name implies, is open source. You can make the modifications you want on the source code to suit your own configuration. This is where open source incenses. And often open source configuration is that we first get the source code provided by the developer (emphasis: all open source is applicable to the following configuration process)
1. Configuration environment: configue + select the location to be configured.
2. Make is used to compile. It reads instructions from Makefile and then compiles.
3. make install is used to install, it also reads instructions from the Makefile and installs to the specified location.

Detailed operation

1. Download the source code: https://www.sqlite.org/2016/sqlite-autoconf-3110000.tar.gz
2. Unzip the file and create a folder to place the location to be configured to prevent the loss of the configuration environment:
Insert picture description here

Insert picture description here
Insert picture description here
2. configue configuration environment
Insert picture description here
3. make compile
Insert picture description here
4. make install install to the directory of prefix, currently enter make install:
Insert picture description here

5. Copy the library files and header files to the system for easy global call
Insert picture description here

Insert picture description here

#include <stdio.h>
#include <sqlite3.h>
int main(int argc, char *argv[])
{ sqlite3 *handle = NULL; int iret = 0; iret = sqlite3_open(“test.sq3”, &handle) ; if (iret != SQLITE_OK) { printf("sqlite3_open error, reason = %s\n", sqlite3_errmsg(handle)); return 0; } if(handle != NULL) { (void)sqlite3_close(handle); } return 0; } Copy the above code gedit sqlite.cpp gcc -o test test.c -lsqlite3 #default link dynamic library The following is the configuration is complete! Nanny level tutorial

















Insert picture description hereInsert picture description here

Guess you like

Origin blog.csdn.net/z15005953031/article/details/114711769