0

I develop an iphone application which uses sqlite3 as a database. That time my OS X version was leopard. So add added libsqlite3.0.dylib to frameworks and compile without any problems it complied and with any problems I could run it on the device as well.

This week I installed Snow Leopard on my Mac. Removing old Leopard version and install a fresh Snow leopard system.

But my problem is now I cannot compile that program because it will give errors with sqlite3 library. I added sqlite3.0.dylib using selecting targets and then selecting file. Also tried adding selecting it from directly /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/usr/lib

I get two different errors when I compiled to device and to simulator

when compiled to device, ld: warning: in /opt/local/lib/libsqlite3.0.dylib, file is not of required architecture*

When compiled to simulator, ld: warning: in /opt/local/lib/libsqlite3.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/usr/lib/libSystem.dylib, missing required architecture i386 in file ld: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/usr/lib/libobjc.A.dylib, missing required architecture i386 in file Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

i also tried with adding sqlite3.dylib (, I think sqlite3.0.dylib is linked to sqlite3.dylib.) but no luck.

Could any one out there give me any help. I'm really trying to get this working. Please let me if you want more details.

Thank you, Waruna

1
  • Are you using libsqlite3.0.dylib or libsqlite3.dylib ? Commented Jul 21, 2010 at 15:24

3 Answers 3

1

Might be a little late for the original requestor. But what works for me is to go to finder and delete the libsqlite.dylib file(s) from the folder of your project and add the framework reference in again.

hope this helps

Sign up to request clarification or add additional context in comments.

Comments

0

You must link to the library which is in the SDK path. When you select "Add Framework..." you will be presented with a list of frameworks available in the default path. Don't navigate away from this list, but select the sqlite library from the list.

The library located in /opt/local/lib/ is only for use by application running on your computer. Not for iPhone applications.

5 Comments

Hey Claus I did that , but still it gave me same errors , that why tired navigating away from default path and tried other methods. Do you have any idea why. This perfectly worked in Leopard.
" ld: warning: in /opt/local/lib/libsqlite3.0.dylib, file is not of required architecture" shows that your are actually linking with the wrong library. Try deleting the library from your project and adding it again.
yeah i did that , but no luck :(
Make sure you don't have any custom search paths defined which misdirect the linker to look in odd places for the library.
That didnt worked either, I created new project and check then it worked fine. After that import all source code to new project, and now working fine
0

I do not understand why add the library bundled with your OS. Why not just add the sources to your project? it will give you freedom to update the version of SQLite on your own terms and do not depend on the SQLite on your box. what happens if a user is running an older version of the OS? will you force them to upgrade their system?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.