$ ./configure CC=arm-hisiv400-linux-gnueabi-gcc --host=arm-hisiv400-linux-gnueabi --prefix=/home/sjlim5092/cross_root/
$ make
$ make install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sqlite3.h"
int create_table()
{
sqlite3 *db; // database connection
int rc; // return code
sqlite3_stmt *stmt;
char* query = "CREATE TABLE data (id INTEGER PRIMARY KEY, "
"key_string TEXT CHECK(typeof(key_string)='text'), "
"group_mask INTEGER CHECK(typeof(group_mask)='integer'), "
"lp_text TEXT CHECK(typeof(lp_text)='text'), country TEXT CHECK(typeof(country)='text'));";
rc = sqlite3_open(SQL_DB_PATH, &db);
if (rc != SQLITE_OK) {
printf("[%s] ERROR opening SQLite DB : %s\n", __func__, sqlite3_errmsg(db));
goto out;
}
//create basic_facedata
sqlite3_prepare_v2(db, query, -1, &stmt, NULL);
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
printf("[%s] ERROR create table: %s\n", __func__, sqlite3_errmsg(db));
goto out;
}
sqlite3_finalize(stmt);
sqlite3_close(db);
printf("facedata table created.\n");
return 1;
out:
if(stmt)
sqlite3_finalize(stmt);
if(db)
sqlite3_close(db);
return 0;
}
int main()
{
int ret = 0;
ret = create_table();
if(ret == 0)
{
printf("\e[33m failed...."\e[0m\n");
return 0;
}
return 1;
}
|
cs |
gcc -o test_sql test.c -I /data2/sjlim87/cross_root/include/ -I /data2/sjlim87/cross_compile_src/test_src/sqlite_test/ -L /data2/sjlim87/cross_root/lib -lsqlite3
gcc -o test_sql test.c -I /data2/sjlim87/cross_root/include/ -I /data2/sjlim87/cross_compile_src/test_src/sqlite_test/ -L /data2/sjlim87/cross_root/lib -lsqlite3
hostapd 데몬을 이용한 wifi usb 동글 AP 모드 사용 (3) | 2020.07.16 |
---|---|
vuejs 에서 moment lib 사용하여 utc time 을 local time 으로 변경하기 (0) | 2020.03.06 |
error: stray '\357' in program 오류 해결방법 (0) | 2018.12.18 |
tcpdump 크로스 컴파일 (cross compile arm) (2) | 2018.12.14 |
환경변수를 이용한 공유라이브러리 후킹 방법 (0) | 2018.12.01 |