I am developing a rhino grasshopper plugin. I wrap c++ CGAL library function into C#, compiling it as a dll.file. And however, I found if the user wants to use this, they have to install C++ on their own computer. (use Visual Studio to download and install).
The user has installed rhino. Rhino is developed based on c++. isn’t it? Why is the user able to run Rhino without installing c++. Does it make sense?
Here is the chat with ChatGPT. Is that a correct answer?
Users don’t need to install any compilers or IDEs. But you as the developer of your plugin need to bundle all the dependencies that make your plugin work. So if your plugin depends on CGAL then you need to bundle all the DLLs that together form CGAL in addition to the assembly you create.
If you compile the CGAL library with a very modern compiler, or very old compiler for that matter, you may have to ensure that the correct vc runtime distributables get installed.
Before going to the C# development environment I am currently testing my own built dll. with python first.
So I have a C# wapper called CGAL.wrapper.dll and a C++ native function called CGAL.Native.dll.
Using clr I can import dll. I used this way to use kangarooSolver.dll, Plankton.dll…
My GHpython script works immediately after I installed “this whole thing” on someone’s computer.
Before installing I got this error msg on his computer. I have tried to copy it everywhere, the grasshopper file folder, grasshopper library folder, set the system environment path, set the rhino python editor module search path etc…
You as developer may want to have C++ tools installed if you need to compile the native function DLL, but your users will not have to if you manage to bundle your plug-in correctly.
if you are using current cgal 5.x, which indicates it is a header-only library (since v5), then I infer that you are compling this cgal dll yourself, and that you are doing this with visual studio 2022 as shown in your screenshot
if so, and if it works when you have your user install visual studio 2022, then it is likely you are using the v143 toolset to build, and should have your user install the current msvc++ redist
rhino 7 uses v140, so any redist that it installs for its own purposes will not be sufficient for your build (provided I am guessing correctly about what you are doing)