Upgrading xcode to Version 14.3.1 (14E300c) causes compilation errors

It was working till 1, June 2023. The project was stable for 5 years. But after upgrading xcode to 14.3.1 getting error “Call to undeclared function ‘sqlite3_rekey’; ISO C99 and later do not support implicit function declarations”.

Is there any workaround? We extremely need any solution. Thank you in advance.

Hi @Yana_Syritskaya,

Thanks for your interest in SQLCipher and for posting to the discussion forum.

This warning/error typically means that you’re not properly importing SQLCipher’s variant of the sqlite3.h. How are you integrating SQLCipher? Are you following the instructions on this page: SQLCipher Community Edition - iOS and macOS Tutorial - Zetetic if you’re using Community Edition? or these instructions SQLCipher for iOS and Mac Catalyst - Zetetic if you’re using Commercial Edition?

It could also be that you have a separate dependency which transitively include/links standard SQLite. This post is example of that: Cannot open encrypted database with SQLCipher 4 - #4 by mmoore

If you’re using SQLCipher Commercial edition, feel free to reach out to us at support@zetetic.net for private prioritized support.

Hi @mmoore thanks for your reply.

Unfortunately the integration was done long time before I came to the project and we had a lot of releases for these 2 years having SQLCipher integrated, the issue raised after xcode upgrade. I know that the xcode compiler was changed in it’s last version, so the issue is not caused by wrong integration. As far as I can see it’s the source integration.

Unfortunately all the URLS provided are older than June 2023 when xcode changed it’s compiler. It was working in May and we successfully built SQLCipher with May 2023 version of xcode. So the URLS not relevant.

Please help.

@mmore there are also other teams facing same issues, ISO C99 and later do not support implicit function declarations on MacOS. How to fix? | Qt Forum they also want to contact

@Yana_Syritskaya

so the issue is not caused by wrong integration

We’ve tested SQLCipher integration with Xcode 14.3.1 both via CocoaPods and by directly building from source and including the sqlite3.c and sqlite3.h files in an Xcode project (Option 1 & 2 from the Community Edition integration instructions). Both work fine without with the warning/error. In both cases the sqlite3_key function should be defined and available in SQLCipher’s variant of the sqlite3.h header (as long as you are defining SQLITE_HAS_CODEC as mentioned in the previously linked integration instructions).

This does indicate that it is an issue with your integration of SQLCipher.

Most likely it is related to one of the two issues mentioned in my previous comment:

  • Not including/importing SQLCipher’s variant of sqlite3.h
  • Linking in the standard version of SQLite (either directly or through a transitive dependency) and incorrectly using that instead of SQLCipher

I would recommend reviewing your integration. One suggestion would be to try to start with a vanilla project which includes SQLCipher first, making sure that works properly and then incrementally adding in additional dependencies/code one by one until you can isolate where the issue is occurring.

It is also possible that your previous databases might not have been encrypted properly, if you have access to any previously encrypted databases, I would recommend trying to open them using a tool like DB Browser for SQLite: https://sqlitebrowser.org

As far as I can see it’s the source integration.

If this doesn’t help, could you check and confirm how you’re integrating SQLCipher.

@mmore Can you please confirm Community Edition integration instructions are valid for security framework of ios 16.4?

@Yana_Syritskaya

@mmore Can you please confirm Community Edition integration instructions are valid for security framework of ios 16.4?

Yes, I’ve tested/run both integration options with Xcode 14.3.1 on iOS 16.4 simulator and iOS 16.5 physical device.

Originally the integration was done by someone before me, so I just followed your steps, removed previously done integration and made a fresh start. It’s weird & surprising it was working all these years with missing sqlite3 in project’s root :exploding_head:.
Thank you for your help. You saved my day!

1 Like

@Yana_Syritskaya

Excellent. Glad I could help.