How to call mojo in c++

Is there any doc for usage of mojo or .so dlopen for C++.

Thanks.

Mojo calling into C++ needs to use a C ABI in C++. C++ calling into Mojo should use @export(ABI="C") on the Mojo function on top of the function and make sure everything is C ABI compatible.

1 Like

Are there any doc pages for @export(ABI=ā€œCā€). Thanks.

The shared library linked by test.cpp runs, but it segfaults before exit. What else can I do to avoid the segfault?

update def to fn works.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.