Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlite c library on mac os?

Tags:

c

sqlite

macos

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.

like image 840
Fred Avatar asked Mar 06 '10 19:03

Fred


People also ask

Can I install SQLite on Mac?

On macOS, you don't need to do anything to install sqlite. It's preinstalled in all modern versions of macOS. command. Press ctrl-C 2 times to exit the SQLite executable.

How do I access SQLite database on Mac?

If you are using Linux or a Mac, open a terminal window instead a command prompt. Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.

Is sqlite3 and SQLite same?

The wiki tag description for both tags is the same: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The sqlite3 has no synonyms but sqlite has sqlitedatabase as a solitary synonym.


2 Answers

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.

like image 140
Carl Norum Avatar answered Sep 28 '22 02:09

Carl Norum


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

like image 28
kennytm Avatar answered Sep 28 '22 00:09

kennytm