Bonjours!
je suis débutant avec SQlite!
je dois realiser une application avec c++ en utilisant SQlite3,
ce code:
m'affiche cette erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 #include <stdio.h> #include <sqlite.h> static int callback(void *NotUsed, int argc, char **argv, char **azColName){ int i; for(i=0; i<argc; i++){ printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); } printf("\n"); return 0; } int main(int argc, char **argv){ sqlite *db; char *zErrMsg = 0; int rc; if( argc!=3 ){ fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]); exit(1); } db = sqlite_open(argv[1], 0, &zErrMsg); if( db==0 ){ fprintf(stderr, "Can't open database: %s\n", zErrMsg); exit(1); } rc = sqlite_exec(db, argv[2], callback, 0, &zErrMsg); if( rc!=SQLITE_OK ){ fprintf(stderr, "SQL error: %s\n", zErrMsg); } sqlite_close(db); return 0; }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 ../Programmation/C++/Sqlite3Test/main.cpp:35: undefined reference to `sqlite3_open' ../Programmation/C++/Sqlite3Test/main.cpp:37: undefined reference to `sqlite3_errmsg' ../Programmation/C++/Sqlite3Test/main.cpp:38: undefined reference to `sqlite3_close' ../Programmation/C++/Sqlite3Test/main.cpp:41: undefined reference to `sqlite3_exec' ../Programmation/C++/Sqlite3Test/main.cpp:44: undefined reference to `sqlite3_free' ../Programmation/C++/Sqlite3Test/main.cpp:46: undefined reference to `sqlite3_close'
Partager