IOS Compile sources as issue


I am trying to use the SQLCipher IOS integration according to SQLCipher Community Edition - iOS and macOS Tutorial - Zetetic. I am having issues with building the project.
I was able to reproduce this on any new project by simply changing “Compile Sources As” from “According to file type” in to “Objective-C++”. See Dropbox - - Simplify your life.
I tried to change the flag to According to file type but I do have some Objective-C++ code and that seems to break → no longer able to see "#include ".

Did anyone have this issue and managed to solve it?


Thanks for your interest in SQLCipher. You need to leave the “Compile Sources As” build setting as “According to File Type” as sqlite3.c is a C Source type and must be compiled as such.

For any files that you’re including an Objective C++ reference in, you’ll need to change the file name to use a double .mm to make sure it’s compiled as Objective C++.

The example project you linked appears to be in Swift, One thing to note is:

You cannot import C++ code directly into Swift. Instead, create an Objective-C or C wrapper for C++ code.

Thank you for the response.
I thought I responded that I fixed the problem by changing to .mm but seems I responded in the “your post is under review page”.
I did a wrapper around the OBJC code (I am integrating also GitHub - project-imas/encrypted-core-data: v2.0 - iOS Core Data encrypted SQLite store using SQLCipher which is actually another wrapper over SQLCipher). Amazingly everything seems to work :smiley:.

Thank you again for your time.