isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.53k stars 2.32k forks source link

How to build Open3D to be able to wrap the DLL for a .NET project? #7062

Open reiseder opened 1 week ago

reiseder commented 1 week ago

Checklist

My Question

I'm trying to compile Open3D to get a DLL which I can use in C++ project which exports methods that I can use in a .NET C# project via P/Invoke.

I have tried hints from #2889 and #5608, or whatever I could find on StackOverflow. Information is sparse.

I managed to build a DLL that I can use in a C++ console application that I created in Visual Studio but not in a project that is compiled to a DLL containing __declspec(dllexport).

As soon as I include Open3D.h my build fails with errors from various Open3D header files. I only have .NET/C# background so I don't know why it's even trying to build these files.

I'm only using the Windows runtime and I have tried to compile main and 0.18.0. The 0.18.0 build fails and/or the INSTALL target doesn't work as expected.

Do you have any information on this?

reiseder commented 1 week ago

When I try to build the main branch with STATIC_WINDOWS_RUNTIME=ON it fails with the following error:

image