Ok I placed the header file into my include folder, then I tryed to compile the following code:
Code:
#include <stdio.h>
#include <sqlite3.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){
sqlite3 *db;
char *zErrMsg = 0;
int rc;
if( argc!=3 ){
fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
exit(1);
}
rc = sqlite3_open(argv[1], &db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
}
sqlite3_close(db);
return 0;
}
and of course I got the following error:
Code:
> Executing: D:\Programm Files\ConTEXT\ConExec.exe "D:\BorlandCompiler\Bin\bcc32.exe" "sqlite.cpp"
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
sqlite.cpp:
Warning W8057 sqlite.cpp 11: Parameter 'NotUsed' is never used in function callback(void *,int,char * *,char * *)
Error E2268 sqlite.cpp 20: Call to undefined function 'exit' in function main(int,char * *)
*** 1 errors in Compile ***
> Execution finished.
Oh yeah... what do you mean by include the lib in your project? Maybe I should really get to DevC++...and get the damn pack from devpaks.org