tags:

views:

42

answers:

2

Does anyone know what is required to be able to read and write to a sqlite database from a c program on mac os x? I have found the sqlite3 commandline tool on os x, but there doesn't seem to be a sqlite.h file anywhere. It's my understanding that coreData can use the sqlite format, the whole thing is quite confusing. When I have looked for an embeded sql library for C, I never know if what I find is the command line tool or a c library or both.

+1  A: 

There is no sqlite.h. The header is called sqlite3.h.

KennyTM
Ok thanks, I found it here now. I saw some references to sqlite.h after some Google searches, but that does not always brings correct answers as we know. Thank you.
Fred
A: 

On my Mac there is a /usr/include/sqlite3.h. You will also need to link your program with the library. Use -lsqlite3 with your link command.

Carl Norum
Oh, yeah I have it too. Hmm, I looked for sqlite.h but I indeed have the sqlite3.h. What is the difference? Is sqlite3.h a newer version only? Thanks.
Fred
`sqlite3.h` is the interface for SQLite version 3.0. Lots more information available at the SQLite webpage: http://www.sqlite.org/version3.html
Carl Norum
Thanks, I will take a look.
Fred