On Sat, Dec 30, 2017 at 5:35 AM, eli <[hidden email]> wrote:
> It would be awesome if SQLite could compile as a part of bigger C++ project.
> Right now there is a bunch of pointer casting errors, that can be fixed in
> a matter of hour IMHO.
Which OS/compiler are you trying?
What is the exact error message you are receiving?
Did you modify t code in any way?
Ditto. Large C++ project - no problem using SQLite.
Are you trying to compile sqlite.c as a C++ file? That won't work obviously, you have to compile as C and link it in.
The sqlite3.h header however can be pulled into any C++ file.
From: sqlite-users [mailto:[hidden email]] On Behalf Of Nelson, Erik - 2
Sent: Tuesday, January 2, 2018 9:50 AM
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] C++ compiler
Eli Sent: Saturday, December 30, 2017 6:36 AM
>It would be awesome if SQLite could compile as a part of bigger C++ project.
>Right now there is a bunch of pointer casting errors, that can be fixed
>in a matter of hour IMHO.
I don't have any trouble using it as part of a larger C++ project.
I have an Objective-C iPhone application developed using Xcode. I have a singleton object which serves as the database controller. I use the SQLite C APIs to interact with the database. It works really well but I’m curious about something.
In my app, I declare my database instance variable like this. (It is a member of the DatabaseController class)
My usage is like this:
int openCode = sqlite3_open(databasePathC, &_database);
I was poking around in FMDB’s source code on github. FMDB is a widely used Objective-C wrapper around SQLite. I was looking to see what they do out of curiosity. FMDB declares and uses the database variable like this:
int openCode = sqlite3_open(databasePathC, (sqlite3**)&_database);
So my question is this: is there some advantage to declaring the database variable as a void pointer and casting it as sqlite3 verses just declaring it as sqlite3?