Hi,
at the moment I try to write a few wrappers for the sqlite api.
Here we are:
##############################################
#include <sqlite.h>
#include <string>
using namespace std;
namespace F {
class FSqLite : public FApplication {
public:
FSqLite() {}
~FSqLite() {}
static int callback(void *NotUsed, int argc, char **argv, char
**azColName);
int sqLiteConnect( const char* stringFileName );
void sqLiteQuery( const char* charSqlQuery );
private:
string stringDatabaseName;
sqlite *db;
};
}
##############################################
My Implementation:
##############################################
namespace F {
static int FSqLite :: callback(void *NotUsed, int argc, char
**argv, char **azColName)
{
return 0; // only for testing
}
int FSqLite :: sqLiteConnect( const char* stringFileName ) {
//sqlite *db;
char *zErrMsg = 0;
db = sqlite_open(stringFileName, 0, &zErrMsg);
if( db == 0 ) {
// there was an error
return -1;
}
else {
stringDatabaseName = stringFileName;
return 0;
}
}
void FSqLite :: sqLiteQuery( const char* charSqlQuery ) {
int rc;
// char *zErrMsg = 0;
char *zErrMsg = 0;
rc = sqlite_exec(db, charSqlQuery, callback, 0, &zErrMsg );
//cout << stringDatabaseName;
}
}
##############################################
I get the following error:
g++ index.cpp -L/usr/local/lib -lsqlite -I/usr/lib/flib -o
index.cgi
In file included from /usr/lib/flib/fsqlite.h:25,
from index.cpp:5:
/usr/lib/flib/fsqlite.cpp:3: error: cannot declare member
function `static int
F::FSqLite::callback(void*, int, char**, char**)' to have
static linkage
[EMAIL PROTECTED]:/srv/www/cgi-bin>
I dont know why :(
Hope to find help here...
Greets from germany
Christian
--
Linux is like a wigwam - no gates, no windows and an apache
inside.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]