Adding SQLCipher to an iOS Xcode project

709 views
Skip to first unread message

SkyTrix

unread,
Dec 24, 2010, 9:38:00 AM12/24/10
to SQLCipher Users
Hi

I am trying to add SQLCipher to my iOS project in Xcode. I've followed
the tutorial on the website (http://sqlcipher.net/documentation/ios)
line by line, but I just don't seem to get it working. I've tried it
several times already with different projects.

When looking at the errors, I see the following:
http://www.freshcreations.be/files/screen_shot_2010-12-24_at_15.26.13_48bc.png

So it kind of looks like I'm missing a file here? I have the latest
version of Xcode installed with the latest 4.2 SDK.

Then at the end of the results, it tells me that libcrypto.a has no
symbols.

Also, what I've noticed while following the tutorial is that I seem to
have the checkmarks in an other place when adding direct dependencies:
http://www.freshcreations.be/files/screen_shot_2010-12-24_at_15.21.20_4973.png
It's on 'make' instead of on 'crypto'.

Also, the static libraries are colored in red in Xcode, but I assume
they are because the libraries aren't compiled yet. Just adding this
to be sure.

Any ideas how to solve my problem?

Thanks,

Cedric

Stephen Lombardo

unread,
Dec 24, 2010, 12:02:35 PM12/24/10
to sqlc...@googlegroups.com
Hi Cedric,

Perhaps this is a long shot, but did you by chance recently upgrade to Snow Leopard? If so, did you re-install the developer tools after you upgraded? We had a few other users report problems similar to this after the upgrade, where basic build tool links (i.e. ranlib) were no longer valid, which affected builds of software outside of XCode using the gcc toolchain.

Cheers,
Stephen

SkyTrix

unread,
Dec 24, 2010, 1:23:54 PM12/24/10
to SQLCipher Users
Hi Stephen

I've been using Snow Leopard since day one and I've updated to every
version of Xcode that came out. So that shouldn't be the problem.

I'll try reinstalling the latest version of the SDK. I hope that'll
help.

Thanks for pointing me in a direction.

Cedric

On Dec 24, 6:02 pm, Stephen Lombardo <sjlomba...@zetetic.net> wrote:
> Hi Cedric,
>
> Perhaps this is a long shot, but did you by chance recently upgrade to Snow
> Leopard? If so, did you re-install the developer tools after you upgraded?
> We had a few other users report problems similar to this after the upgrade,
> where basic build tool links (i.e. ranlib) were no longer valid, which
> affected builds of software outside of XCode using the gcc toolchain.
>
> Cheers,
> Stephen
>
> On Fri, Dec 24, 2010 at 9:38 AM, SkyTrix <cedric.vddriess...@telenet.be>wrote:
>
>
>
> > Hi
>
> > I am trying to add SQLCipher to my iOS project in Xcode. I've followed
> > the tutorial on the website (http://sqlcipher.net/documentation/ios)
> > line by line, but I just don't seem to get it working. I've tried it
> > several times already with different projects.
>
> > When looking at the errors, I see the following:
>
> >http://www.freshcreations.be/files/screen_shot_2010-12-24_at_15.26.13...
>
> > So it kind of looks like I'm missing a file here? I have the latest
> > version of Xcode installed with the latest 4.2 SDK.
>
> > Then at the end of the results, it tells me that libcrypto.a has no
> > symbols.
>
> > Also, what I've noticed while following the tutorial is that I seem to
> > have the checkmarks in an other place when adding direct dependencies:
>
> >http://www.freshcreations.be/files/screen_shot_2010-12-24_at_15.21.20...

Stephen Lombardo

unread,
Dec 24, 2010, 1:31:28 PM12/24/10
to sqlc...@googlegroups.com
Hi Cedric,

I think that a reinstall sounds like a good step. The error you're seeing indicates that /usr/bin/ranlib doesn't exist. This should be a symlink to /usr/bin/libtool on Snow Leopard. Happy Holidays!

Cheers,
Stephen

SkyTrix

unread,
Dec 24, 2010, 2:20:06 PM12/24/10
to SQLCipher Users
Hi Stephen

I reinstalled Xcode and it works like a charm now.

Thanks a lot and happy holidays to you too!

Cedric

On Dec 24, 7:31 pm, Stephen Lombardo <sjlomba...@zetetic.net> wrote:
> Hi Cedric,
>
> I think that a reinstall sounds like a good step. The error you're seeing
> indicates that /usr/bin/ranlib doesn't exist. This should be a symlink to
> /usr/bin/libtool on Snow Leopard. Happy Holidays!
>
> Cheers,
> Stephen
>

John

unread,
Jan 4, 2011, 7:40:26 AM1/4/11
to SQLCipher Users
Hi guys

Happy new year to all of you, and my warmest wishes for the
development team!

I am really interested in using SQLCipher for my iPhone app, I want to
encrypt my sqlite database. I tried to follow the instructions in this
tutorial http://mobileorchard.com/tutorial-iphone-sqlite-encryption-with-sqlcipher/,
but I get compilation errors when compiling sqlcipher (for example
"openssl/evp.h: No such file or directory"). When I open both the
openssl xcode project file and the sqlcipher xcode project file, both
compile fine. It seems that it cannot find the path to the includes,
but I don't understand why, since I have defined the "Header Search
Paths" as explained in the tutorial.

Any ideas? Best regards,
John

PS: My system configuration:
Xcode 3.2.4 and iOS SDK 4.2
Snow Leopard

Billy Gray

unread,
Jan 4, 2011, 8:43:54 AM1/4/11
to sqlc...@googlegroups.com
On Tue, Jan 4, 2011 at 7:40 AM, John <john.kal...@gmail.com> wrote:

 I tried to follow the instructions in this
tutorial http://mobileorchard.com/tutorial-iphone-sqlite-encryption-with-sqlcipher/,
but I get compilation errors when compiling sqlcipher (for example
"openssl/evp.h: No such file or directory"). When I open both the
openssl xcode project file and the sqlcipher xcode project file, both
compile fine.

Hi John,

You might want to check some paths. This sort of the thing is usually the result of one of your defined source trees not being quite right. If you go to XCode -> Preferences -> Source Trees, take a look at the path for your openssl source (mine is called OPENSSL_SRC), and if you're not quite sure you typed it in just right, try testing the path in Terminal with the ls command.

Another thing you might check is how you set up the cross-project references in the project you are trying to build. If you right-click on the sub-project icon for openssl-xcode in your own project, and select Get Info, you should see the Path and Path Type listed on the panel that appears, and that may give you a clue as to what's off.

This is what one of mine looks like:

Path: /Users/wgray/Documents/Sources/openssl-1.0.0/openssl.xcodeproj
Path Type: Relative to OPENSSL_SRC

Regards,
Billy Gray

--
Team Zetetic
http://zetetic.net

John

unread,
Jan 4, 2011, 6:12:46 PM1/4/11
to SQLCipher Users
Hi Billy

Thanks for your answer.

My paths seems to be correct, and I still get the same compilation
errors, despite the fact that I installed the newest version of Xcode
(3.2.5) and iOS SDK. I also noticed that I have checkmarks on the
sqlcipher of sqlcipher project, and the make of openssl. Would that
make a difference?

Thanks,
John

PS: Would it matter that my path contains a space (/Users/nemesis/
Documents/App Development/openssl-1.0.0c)?

Billy Gray

unread,
Jan 5, 2011, 11:02:45 AM1/5/11
to sqlc...@googlegroups.com
Hi John,

The space in your path really shouldn't matter to our Run Script in the make target of openssl-xcode, but it could be a bother to XCode, maybe try adjusting it?

The other thing you might want to verify is the header search paths listing. If you select your application's target, Get Info on it, select the Build tab, and look up the Header Search Results in that listing (it's not available via Project -> Edit Project Settings -> Build), make sure that you've got the src variable names just right, and that both are marked as recursive.

If that's not working, you could change your openssl search path to

$(OPENSSL_SRC)/include

Which is specifically where the headers will be found.

Hope that helps some,
Billy

John

unread,
Jan 5, 2011, 4:07:52 PM1/5/11
to SQLCipher Users
Hi guys

I am just posting again so as to somehow store the answer online.

Indeed, I just copied the source folders to my desktop (so the path
was /Users/nemesis/Desktop/sqlcipher), and it compiled just fine. I
moved i back to my original location (the one that includes the space
in the path), and the compilation complained.

Bottom line: strict tutorial instructions + Xcode 3.2.5 + iOS SDK 4.2
+ source code paths without blank space => compiles fine (even though
the checkmarks are on sqlcipher and make)

Thanks a lot for your support. Best regards,
John
Reply all
Reply to author
Forward
0 new messages