Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
K

Kurukuru

Guest
Original poster
Hi all,

I'm an experienced C++ developer, but am relatively new to Mac development. I want to write an application that makes use of a simple database and SQLite3 would suit my needs.

Mac OS X 10.5.6
Xcode 3.1.2

I've #included sqlite3.h, and pulled /usr/lib/sqlite3/libtclsqlite3.dylib into the project's Products section, and I get a runtime error when hitting the first SQLite3 call, sqlite3_open(...):
dyld: Library not loaded: /usr/lib/sqlite/libtclsqlite3.0.dylib
Reason: image not found


Indeed, /usr/lib/sqlite/libtclsqlite3.0.dylib does not exist on my machine, and I don't know why it's being referenced. How do I control this? Why is /usr/lib/sqlite3/libtlcsqlite3.dylib not being loaded, as that's the library I've added to the project?

Thanks for any help you can offer.
 

garethlewis2

macrumors 6502
Dec 6, 2006
277
1
You don't need to link the dylib of Sqlite3 on OS X. sqlite3 is bundled as part of the OS as a prebound library and separate executable, all you need to do, is pass gcc the -lsqlite3 option to link it.
 
K

Kurukuru

Guest
Original poster
Thanks for the information. I'm still learning my way around Xcode...How do I provide gcc with the -lsqlite3 option, as I'm doing the build from the IDE, not the command line?

Actually, I'd really like some documentation about this kind of thing, but haven't found anything specific to how Xcode builds the command lines for the tools; can you recommend anything?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.