26+ errors when building iOS Swift project

I have been attempting to build an iOS + Swift + CouchbaseLite project.

(iOS 9+)

I have followed all of the tutorials.
I have search Google high and low.

My bridging header is being recognised - I have auto complete for all the classes/objects.

If I add “-ObjC” to the other linker flags - I get 26+ build errors.

The first of 26…

std::__1::__vector_base_common::__throw_length_error() const", referenced from:indent preformatted text by 4 spacesvoid std::__1::vector<CBLMovedRange, std::__1::allocator
::__push_back_slow_path(CBLMovedRange&&) in CouchbaseLite(CBLArrayDiff.o)

If I do not add the flag, the project builds and I can successfully get a reference to the CBLManager, however another error message shows…

WARNING: Upgrade skipped: Database upgrading class is not present. {at -[CBLManager upgradeOldDatabaseFiles]:341}
15:51:07.227| WARNING: storageType is ‘SQLite’ but no CBL_SQLiteStorage class found; make sure -ObjC is in Other Linker Flags in Build Settings

I am stuck.
I am fed up.

Can anyone help? Does anyone have a stub project (+iOS 9 / Swift) that I can use to start?

You need to link against the libc++ system library.

1 Like

Oh. My. God.

Thank you so much. I’ve been so frustrated by the errors. There are a LOT of tutorials that should be updated to include this library.

This question is the same as mine, but after linking with the C++ library I get additional “duplicate symbol” errors. Suggestions?


I suggest you show us what the link errors are, otherwise I have no idea… :confused:

The error messages are in the linked thread.