- Operating System: Ubuntu 18.04.4 LTS
- Kernel: Linux 5.3.0-1018-raspi2
- Architecture: arm64
I'm trying to build libmongoc 1.13.0 from source. I'm building this on a Raspberry Pi 4 running Ubuntu 18.04.4. running For context, my eventual goal is to build this Swift library, which depends on MongoSwift, which depends on libmongoc. I'm building version 1.13.0 specifically because I think because the version of libmongoc-dev installed from apt-get is wrong. When I try to compile MongoSwift, I get a bunch of errors (truncated because posting the full output triggered the spam filter):
/home/cooper/backup/CooperKnaak/.build/checkouts/mongo-swift-driver/Sources/MongoSwift/BSON/Overwritable.swift:68:58: error: use of unresolved identifier 'bson_iter_overwrite_oid'
iter.withMutableBSONIterPointer { iterPtr in bson_iter_overwrite_oid(iterPtr, oidPtr) }
^~~~~~~~~~~~~~~~~~~~~~~
When I download the version 1.13.0 release, the bson_iter_overwrite_date_time functions seem to be defined. This seems to be the version on my Mac, which does build the Swift libraries correctly.
I've followed the instructions to install the MongoDB C Driver, but I can't build. I've installed the 3 dependencies:
cmake: version 3.10.2-1ubuntu2.18.04.1libssl-dev: version 1.1.1-1ubuntu2.1~18.04.5libsasl2-dev: 2.1.27~101-g0780600+dfsg-3ubunt
I can successfully download the tarball, create the cmake-build directory, and run cmake. But running make fails with
[ 37%] Linking C executable common-operations
libmongoc-1.0.so.0.0.0: undefined reference to `usprep_prepare_61_swift'
libmongoc-1.0.so.0.0.0: undefined reference to `u_strFromUTF8_61_swift'
libmongoc-1.0.so.0.0.0: undefined reference to `usprep_openByType_61_swift'
libmongoc-1.0.so.0.0.0: undefined reference to `u_strToUTF8_61_swift'
libmongoc-1.0.so.0.0.0: undefined reference to `usprep_close_61_swift'
collect2: error: ld returned 1 exit status
src/libmongoc/CMakeFiles/common-operations.dir/build.make:103: recipe for target 'src/libmongoc/common-operations' failed
make[2]: *** [src/libmongoc/common-operations] Error 1
CMakeFiles/Makefile2:769: recipe for target 'src/libmongoc/CMakeFiles/common-operations.dir/all' failed
make[1]: *** [src/libmongoc/CMakeFiles/common-operations.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
It's getting a bunch of undefined references to things like usprep_prepare_61_swift (where I imagine the actual function is named prepare or strFromUTF8, but I'm not sure).
Can anyone make sense of this error? I'm stumped. I don't know if I have the wrong package version, if the dependencies have the wrong version, or if it's something else.