We have a bit of code using Eigen that we wanted to move to a swift package so we could more easily share it internally, but I've run into a problem as the c++ code we have on top of Eigen uses
The package seems ok, it seems to build ok, say with
swift build, no errors are reported. But if I include the package in a project, or try to run tests, I get errors of the form:
Undefined symbols for architecture x86_64: "__ZN12optionalTest12OptionalTest16optionalVector3fEb", referenced from: +[ObjCOptionalTest nullableFloat3:] in ObjCOptionalTest.mm.o ld: symbol(s) not found for architecture x86_64 [2/3] Linking SwiftyEigenPackageTests error: fatalError
To demonstrate the problem, I made a very basic implementation with a single use of
std::optional using a fork of the SwiftyEigen demo project, you can find it here.
I figured out various things already, using swift tools 5.4, setting minimum platform versions, and using cxxLanguageStandard .gnucxx17, but now I'm utterly stuck and have no clue how to proceed.
Any help greatly appreciated