How to call MLIR function by c++?

-llvm-request-c-wrappers does not invoke MLIR, it only sets the llvm.emit_c_interface attribute on the function(s) so that the proper interface and entry point is emitted.

If you build a .o from that, you should be able to link it and call it from C++ using similar code to what you can see around the invoke method.

This post describes a similar situation to yours: How to compile and link with other c/c++ programs

The reply here gives a step-by-step path, along with an example of an extern “C” declaration like you’d need: How to compile and link with other c/c++ programs - #10 by Wheest