I have a linux c++ sdk that i need to integrate as a dependency into a .NET 6.0 bigger project.
This sdk is only conditionally included for the linux version of the software, i do already have the windows version running with no problems.
This skd exposes only classes in very nested namespaces, and as far as i'm aware, [DllImport]
does not support class methods.
I do already know how to create a wrapper and expose functions with extern "C"
and passing the sdk instances as pointers to a .NET Core application running with no problem under linux systems
My problem is that i do have no idea on how to succesfully compile/include/link the existing .so
files into a .dll or .so that i can then [DllImport]
The sdk has been sent to me with the following structure (take name-of-lib as the placeholder name. I'm not sure if i can expose the real company name so i won't just in case):
run/
|- x86/
| +- {same files as x64 but i don't target x86 arcs so it's useless}
+- x64/
|- install.sh {see #1}
|- libNameModuleA.so.1.2.3
|- libNameModuleB.so.3.2.1
|- libNameApi.so.7.8.9
+- {etc. etc.}
lib/
|- lib-name-api/
| |- doc/
| | +- somehtmlautogenerateddocs.html
| |- include/
| | +- NameApi.h
| +- source/ {optionally for the top level apis}
| +- {varius header .h files}
|- name-of-lib-module-A/
| +- {same as previus, repeat for every .so file}
+- {etc. etc.}
{#1} script that craetes links as libName.so => libName.so.1 => libName.so.1.2 => etc
All of those library header files reference each other like they were in the same folder, using an #include "subLibraryModule.h"
even if this file would actually be in something like ../../subLibrary/include/subLibraryModule.h
.
Also, in the skd there are only headers.
now, what would be the (either, i don't really know waht would be the best tool) cmake, make, g++, gcc command, configuration or procedure to be able to include the top-level header that references all of the other ones in the compilation without a file not found
error from the compiler?
Say i need to compile a single file wrapper.cpp
that includes only the top level headers and contains only extern "C"
functions
I've tried doing this with vscode and intellisense actually resolves the headers correctly, but when i try to compile it everything bursts into a fire of file-not-founds
Am I missing something? Is there further information or files i missed?
Thanks in advance.