Hi there! I glad to write a new problem with C++ interop in my project. I noticed that old flag -enable-experimental-cxx-interop
perfectly works with miniaudio lib that I used. But a brand new one -cxx-interoperability-mode=default
failed build for SPM and Bazel build systems with next error:
external/_main~ada_engine_vendor~miniaudio/miniaudio.h:4437:1: error: import of C++ module 'Darwin.C.stdarg' appears within extern "C" language linkage specification
#include <stdarg.h> /* For va_list. */
^
external/_main~ada_engine_vendor~miniaudio/miniaudio.h:3717:1: note: extern "C" language linkage specification begins here
extern "C" {
^
Sources/AdaEngine/Audio/Engines/MiniAudioEngine.swift:8:29: error: could not build Objective-C module 'miniaudio'
@_implementationOnly import miniaudio
^
It's a similar problem was there: Import of C++ module appears within extern "C" language linkage specification
I've no clue why a new flag has this fatal error for linkage lib inside extern "C"
block, and because miniaudio is external deps, I don't want to move includes outside extern block. How to fix that piece of logic?
You can try to build this app on link below:
The main branch currently doesn't work, because It has been use old -enable-experimental-cxx-interop
flag and It's compiled for old swift driver, but not for Swift 5.9.
P.S. Thanks anyone who can help me to build my project. I really eat some sort of lollipops anytime when I use C++ interop and all times I spent weeks to make this Swift <-> C++ code works as I expected. I hope, that my grandchildren will use a stable, fast and C++ compitable language in their projects, but for now...