0

I am trying to use a class from a closed-source C++ library (only have access to the header files) from a different language, but the bindings generator fails when including the class' header files. Because of this, I need to write a C++ wrapper for that library, but I can't include the class' header file in my wrapper's header file, because bindgen will fail if it's included.

Is there a way to use a class in a header file that isn't included while also allowing that header file to be read on its own (maybe using typedef or extern)?

Example of the setup I would ideally want:

CompiledCode.hpp

class Foo {
    ...
}

wrapper.hpp

// Magic to allow me to use the class name Foo as a return type

Foo createFoo();

wrapper.cpp

#include "CompiledCode.hpp"
#include "wrapper.hpp"

Foo createFoo() {
    return Foo::create();
}
object-Object
  • 1,587
  • 1
  • 12
  • 14

0 Answers0