Certain C++ classes are not available in Swift, but others are

I'm writing a Swift app that uses the Blackmagic ATEM SDK, which is written in C++. The SDK has two files: BMDSwitcherAPI.h and BMDSwitcherAPIDispatch.cpp, and I've compiled them into an Xcode package called BlackmagicSDK.

However, I can't declare variables with types that are declared as C++ classes, only those declared using typedef. For example, I can't declare a constant of type IBMDSwitcher, which is declared like this:

// BMDSwitcherAPI.h
class BMD_PUBLIC IBMDSwitcher : public IUnknown
{
public:
    ...
}

If I try to use it in Swift, this happens:

// Switcher.swift
import BlackmagicSDK

struct Switcher {
	let interface: IBMDSwitcher // Error: "Cannot find type 'BMDSwitcher' in Scope"
}

There are some classes (about 170) that are declared like this:

// BMDSwitcherAPI.h
class IBMDSwitcherAudioHeadphoneOutput;
class IBMDSwitcherAudioHeadphoneOutputCallback;
...

I can access a small subset of these (around 10) but there doesn't seem to be any pattern to the ones I can access, except they're all declared using the simpler syntax instead of the full class declaration.

I can also access types like BMDSwitcherInputID and BMDSwitcherVideoCodec, which are declared like this:

// BMDSwitcherAPI.h
typedef int64_t BMDSwitcherInputId;
typedef uint32_t BMDSwitcherVideoCodec;

My best theory for this is that these types are aliases of C++ standard library types that Swift understands. I still don't fully understand what typedef actually does, though.

My final clue is the global function that returns a class for connecting to the ATEM hardware over the network, which I can access. Xcode shows the return type as an Opaque Pointer!. The closest I found online is OpaquePointer, which Apple says is "used to represent C pointers to types that cannot be represented in Swift". I don't know if that's relevant or just a red herring, though.

I am no expert in C++ (haven't touched that since the 90s) but I would expect an error trying to declare a variable or property of a type that cannot be instantiated, so perhaps this is the issue?

The way you're supposed to use it is by calling IBMDSwitcherDiscovery::ConnectTo method (I can't access the IBMDSwitcherDiscovery class either). If I create a type without public initialiser in Swift, I can still access it when declaring structs:

// Switcher.swift
struct PrivateType {
	let property: String
	private init(_ property: String) {
		self.property = property
	}
}

struct Switcher {
	let ipAddress: String
	let name: String
	let interface: PrivateType
}

I'm no expert in C++ either (hence why I'm trying to use Swift instead), but I found a page about classes on cplusplus.com which seems to say that don't necessarily even need constructors?

Interestingly, I can access the global function that creates the IBMDSwitcherDiscoveryInstance type (CreateBMDSwitcherDiscoveryInstance()), but Xcode shows it as an Opaque Pointer! type. The closest I found is OpaquePointer, which Apple says is "used to represent C pointers to types that cannot be represented in Swift". Could that be relevant?

I've also discovered that there are about 170 lines of classes in the header file that are declared like this:

class IBMDSwitcherAudioHeadphoneOutput;
class IBMDSwitcherAudioHeadphoneOutputCallback;
...

After changing the umbrella header file to use #import instead of #include, I'm now able to access a small subset of these (about 10). I can't discern any logic to which classes I can access, except that they all seem to be these "baby" classes, not ones declared in the normal way. Is it possible that the compiler just can't handle a C++ header with 5000+ lines of type declarations?