views:

405

answers:

1

I have been working on a project which uses Tiger's SQLite3 library (which if I remember well is contained in CoreData.framework?) and came across a problem when building with the "Release" config. I get linking errors telling me the sqlite3 symbols I use through my project are undefined. I'm pretty sure this is due to the needed sqlite3 library not being linked in the Release build but I can't seem to find why and where to set the Release build's linking.

My project has no problem compiling in the Debug config. I have the CoreData.framework under "Other Frameworks" in my project. I tried putting it under "Linked Frameworks" but that does not change the outcome of the build.

I have tried to find differences between the Debug and Release build configs in the Build Preferences but I can't seem to find anything different related to linking which could cause this issue.

I bet there's a very small operation I should have done to prevent this but I did my research and I still can't seem to find anything anywhere. Some hints but nothing that helped me much so far. So I'm calling for your expertise.

If you need any more info just tell me I'll update the question.

Thanks in advance!


UPDATE 1: I disabled the ZeroLink option in my target (for some reason I don't understand there is another option for this in the project's build tab which was disabled by default) and now the linking problem happens in the debug build configuration too, so I guess it's a step in the good direction. Now I only need to link the library. I have read the Apple docs on linking but I can't seem to find a way to make it work.

What I don't know:

  • Where exactly is Tiger's SQLite3 library which ZeroLink linked to previously to make it work? (is it /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/sqlite3/libtclsqlite3.dylib ?)
  • How to add the library to my project's build. I tried dropping the dylib in my Frameworks and Target's "Link Binary With Libraries" but the build displays some other errors related to the dylib file.


UPDATE 2: I solved my problem by including the SQLite3 amalgamation (.c and .h source files) in my project so they are built with it. I still don't know how to link a dylib though, and am interested in knowing where the SQLite3 library is in Tiger / Leopard.

A: 
  1. ZeroLink is deprecated and has been removed from Xcode for several versions. Pay no attention to it. The linker is faster now and ZeroLink was problematic.
  2. If you must link with Tiger's sqlite3, all you need to do is add this to your Other Linker Flags:

    -l/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libsqlite3.dylib

That will force linkage with the 10.4 version of sqlite.

cdespinosa
I didn't know ZeroLink was enabled but I read bad things about it before I asked the question, basically I supposed it was OFF since it was unchecked in the project's build tab. But it was ON in the target build settings so it was used. Also, libsqlite3.dylib isn't in the 10.4 sdk I have... I only have libtclsqlite3.dylib in a sqlite3 folder. Anyway I am OK with the sqlite3 amalgamation so I'll stick with that. But thanks for telling me the linker flag and for taking the time to answer my newbish question!Peace
Form