SQLite3 symbols undefined?
SQLite3 symbols undefined?
- Subject: SQLite3 symbols undefined?
- From: Wesley <email@hidden>
- Date: Fri, 13 May 2005 18:16:26 -0600
Hi,
Using my shiny new copy of Tiger, I'm trying to play a bit with
sqlite3, and using the code below, I get the following errors:
$ make sqTest
g++ -c -o sqTest.o sqTest.cpp
cc sqTest.o -o sqTest
/usr/bin/ld: Undefined symbols:
std::ios_base::Init::Init()
std::ios_base::Init::~Init()
___gxx_personality_v0
_sqlite3_close
_sqlite3_errmsg
_sqlite3_exec
_sqlite3_open
collect2: ld returned 1 exit status
make: *** [sqTest] Error 1
The code is pretty much straight off the sqlite3.org website:
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
using namespace std;
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;
}
Any idea what I'm doing wrong?
Cheers,
Wesley
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden