![]() Other than that, you can use any C++ features you like in the implementation (including Eigen). We also need to define C linkage in the definition of the interface. ![]() Because the interface file will be seen by both the C++ and the C compiler, we wrap the extern declaration in #ifdefs which will only trigger for the C++ compiler. We use extern "C" to instruct the C++ compiler to use the C rules. Library interface /* foo.h */īy default, C++ uses different mangling rules than C for names of exported functions. Here is a small example how one could write such a library. ![]() However, you can wrap the parts using Eigen in a separate shared library and expose a C interface. As such, it cannot be directly used from a C translation unit. Eigen is a library which heavily uses C++ features which are not present in C. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |