p2 / Redland-ObjC

Objective-C wrapper for the Redland RDF libraries
Other
20 stars 11 forks source link

Dependencies and stuff #2

Closed ljos closed 11 years ago

ljos commented 11 years ago

Hi, I have been working with this project and iOS the past week, as you've already seen from the PR i sent, and I think I have discovered some problems.

The first is that the example in the readme is incomplete. I have written a more complete example that works, you can see it on my branch. I am however a bit unsure if it a good way to be using the library, so I haven't issued a PR to you with it.

Secondly, the description of how to use it, at least on iOS, is not complete. This might be because of an update in Xcode at some point. What didn't work was to select and pull the *.a files into /Link Binary with Library/, but I had to select the libraries and then on the right side I check off on Target Membership for Redland and redland-ios. I also had to add libsqlite3.0.dylib to my project target (in link binary with..).

Other than that the project seems to work nicely. I have some improvements in mind, but I want to work a little bit more with the project to see if it is just that I am not familiar with it that makes me want to change it :) .

p2 commented 11 years ago

Yes, very good that you're using it! I am using it in our SMART Framework but that project is running slow at the moment, so I haven't 100% finished either framework.

The example indeed is incomplete, the subject is missing and wrongfully was replaced with model. You can see how you generally use the framework in the unit tests in Redland (esp. StatementTests), but yours is correct. If you're sure it's running send a PR!

As for using/installing, you definitely don't need libsqlite; at least my app runs without it. :)

The dragging over indeed does no longer work in Xcode 4.5, and your way with just checking its target membership off is better anyway because the user of the framework does not need to do that. I'll push a fix to this myself but I won't touch the README, send me a pull request once you think you have it ready.

Thanks!

p2 commented 11 years ago

Speaking of the README, I'll adjust the instructions accordingly.

ljos commented 11 years ago

If I remove the libsqlite library I get this error:

Undefined symbols for architecture i386:
  "_sqlite3_close", referenced from:
      _librdf_storage_sqlite_close in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_column_text", referenced from:
      _librdf_storage_sqlite_get_next_common in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_get_next_context_common in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_errmsg", referenced from:
      _librdf_storage_sqlite_open in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_serialise in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_get_next_common in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_serialise_finished in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_find_statements in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_find_statements_finished in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_context_serialise in libredland-ios.a(rdf_storage_sqlite.o)
      ...
  "_sqlite3_exec", referenced from:
      _librdf_storage_sqlite_exec in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_finalize", referenced from:
      _librdf_storage_sqlite_get_next_common in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_serialise_finished in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_find_statements_finished in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_context_serialise_finished in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_get_next_context_common in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_get_contexts_finished in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_free", referenced from:
      _librdf_storage_sqlite_exec in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_last_insert_rowid", referenced from:
      _librdf_storage_sqlite_set_helper in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_open", referenced from:
      _librdf_storage_sqlite_open in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_prepare", referenced from:
      _librdf_storage_sqlite_serialise in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_find_statements in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_context_serialise in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_get_contexts in libredland-ios.a(rdf_storage_sqlite.o)
  "_sqlite3_step", referenced from:
      _librdf_storage_sqlite_get_next_common in libredland-ios.a(rdf_storage_sqlite.o)
      _librdf_storage_sqlite_get_next_context_common in libredland-ios.a(rdf_storage_sqlite.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ljos commented 11 years ago

I want to add some comments and stuff to the example in the README before I make a PR. I will do this later tonight.

p2 commented 11 years ago

Oooh, in the storage! I'm not using storage, but yes, I was wrong, if you use it you'll need it as well. I'll add this to the instructions. I'm testing the stuff that I've changed and will push later.

ljos commented 11 years ago

What would be nice would be to add Core Data as a storage platform for the libraries, but that would probably require some major patches to the librdf libraries...

p2 commented 11 years ago

I hate Core Data. :)

I've made a small demo app, will push shortly.

p2 commented 11 years ago

Demo app is at [https://github.com/p2/RedlandDemo]() and I think most of the points mentioned here are now implemented and I'll close this issue. Thanks for all your help, happy to implement further improvements of course!