Couchbase Lite C builds

Hi,

I am developing an app using Flutter and Couchabse Lite is an excellent match. Currently there is a plugin that uses the iOS and Android DSK to support those platforms but I would like to support desktop also. As of today Firebase is the only suitable solution for offline-only database for flutter, but I’d rather use Couhcbase.

Although both Flutter, Dart’s FFI library, and Couchbase-Lite-C are still in early stages, I wouldn’t mind giving a shot at implementing a plugin in Dart using the C SDK myself.

Is there any plan to provide pre build libraries, at least for the major platforms (macOS, windows, linux)? Would that be possible?
I tried building on Windows and I can’t seem to get the libraries built using Cmake, Unfortunately, building C libraries is way over my abilities.

Thank you.

We don’t have any plans to do that as far as I know, but CMake usually makes building these sorts of projects very easy even for people inexperienced with building these sorts of libraries (assuming the project is working correctly, of course, which for this sort of experimental build is not a guarantee). That sort of thing would come with the decision to productize. Right now it’s just out there for people to tinker with.

Thanks, for the reply.

Well, I tried to build a few weeks ago and failed, tried again a few days ago and failed but now with an entirely different error. Here’s what I tried and the outputs, maybe you can give me some pointers on how to build it.

I’m building on windows using cmake 3.17.3
I am getting these “error C3646: ‘_cbl_deprecated’: unknown override specifier” errors, I’m not sure if they should be breaking error or not, but I do not get any of the libraries as a result.

Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Checking Build System
BLIPStatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Networking\BLIP\Debug\BLIPStatic.lib
Building Custom Rule D:/projects/couchbase-lite-C/CMakeLists.txt
CBLBase.cc
CBLBlob.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
CBLDatabase.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
CBLDocument.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
CBLLog.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
CBLQuery.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
CBLReplicator.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
ConflictResolver.cc
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(199,83): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
D:\projects\couchbase-lite-C\include\cbl\CBLBlob.h(204,82): error C3646: ‘_cbl_deprecated’: unknown override specifier
[D:\projects\couchbase-lite-C\CouchbaseLiteCStatic.vcxproj]
Listener.cc
Util.cc
Generating Code…
CouchbaseSqlite3.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Debug\CouchbaseSqlite3.lib
FleeceStatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\fleece\Debug\FleeceStatic.lib
c4Base.cc
LiteCoreStatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Debug\LiteCoreStatic.lib
LiteCoreWebSocket.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Debug\LiteCoreWebSocket.lib
SQLite3_UnicodeSN.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\sqlite3-unicodesn\Debug\S
QLite3_UnicodeSN.lib
mbedcrypto.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\mbedtls\crypto\library\Debug\mbe
dcrypto.lib
mbedx509.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\mbedtls\library\Debug\mbedx509.lib
mbedtls.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\mbedtls\library\Debug\mbedtls.lib
zlibstatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Networking\BLIP\vendor\zlib\Debug\zlibs
taticd.lib

I deleted the _cbl_deprecated flags in the CBLBlob file, which then results in the following error:

BLIPStatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Networking\BLIP\Debug\BLIPStatic.lib
CBLBlob.cc
CBLDatabase.cc
CBLDocument.cc
CBLLog.cc
CBLQuery.cc
CBLReplicator.cc
ConflictResolver.cc
Listener.cc
Util.cc
Generating Code…
CouchbaseLiteCStatic.vcxproj → D:\projects\couchbase-lite-C\Debug\CouchbaseLiteCStatic.lib
CouchbaseSqlite3.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Debug\CouchbaseSqlite3.lib
FleeceStatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\fleece\Debug\FleeceStatic.lib
LiteCoreStatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Debug\LiteCoreStatic.lib
LiteCoreWebSocket.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Debug\LiteCoreWebSocket.lib
SQLite3_UnicodeSN.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\sqlite3-unicodesn\Debug\S
QLite3_UnicodeSN.lib
mbedcrypto.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\mbedtls\crypto\library\Debug\mbe
dcrypto.lib
mbedx509.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\mbedtls\library\Debug\mbedx509.lib
mbedtls.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\vendor\mbedtls\library\Debug\mbedtls.lib
zlibstatic.vcxproj → D:\projects\couchbase-lite-C\vendor\couchbase-lite-core\Networking\BLIP\vendor\zlib\Debug\zlibs
taticd.lib
Building Custom Rule D:/projects/couchbase-lite-C/CMakeLists.txt
empty.cpp
LINK : fatal error LNK1104: cannot open file ‘D:/projects/couchbase-lite-C/src/CBL.def’ [D:\projects\couchbase-lite-C\C
ouchbaseLiteC.vcxproj]

The CBL.def is in the “/src/exports/” folder not “/scr/”. I tried moving it to the “src” folder, but that results in:

CBL.def : error LNK2001: unresolved external symbol CBLEndpoint_NewWithLocalDB [D:\projects\couchbase-lite-C\CouchbaseLiteC.vcxproj]
CBL.def : error LNK2001: unresolved external symbol CBL_SetLogLevel [D:\projects\couchbase-lite-C\CouchbaseLiteC.vcxproj]
D:/projects/couchbase-lite-C/Debug/CouchbaseLiteC.lib : fatal error LNK1120: 2 unresolved externals [D:\projects\couchbase-lite-C\CouchbaseLiteC.vcxproj]

At this point I have no clue what to do, so I gave up