How to create a Rhino-dependent C++ DLL

Every now and then, the question about how to create a Rhino-dependent C++ DLL comes up.

A Rhino-dependent C++ DLL is one that links with Rhino C++ SDK libraries, and that can be used to add functionality that can be shared between multiple C++ plug-ins, or that can be used to add Platform Invoke (PInvoke), interop functionality to RhinoCommon or Grasshopper plug-ins.

There are the simple steps for building a Rhino-dependent C++ DLL.

  1. Download and install the Rhino C/C++ SDK per these instructions.

  2. Create a Rhino C/C++ plug-in project per these instructions.

  3. In Visual Studio - Solution Explorer, delete the plugin .cpp and .h files, and delete the command .cpp file.

  4. In Visual Studio - Property Manager, remove the Rhino.Cpp.PlugIn property page from both the Debug|x64 and the Release|x64 build configurations.

  5. Again in Visual Studio - Property Manager, add the Rhino.Cpp.PlugInComponent.props property page to both the Debug|x64 and the Release|x64 build configurations. This property page are found in the PropertySheets folder in the Rhino C++ SDK folder.

Done - you now have a Rhino-dependent DLL project. Now you are ready to add your functionality; either by adding or linking in other libraries, or by exporting custom C++ functions.

Additional information:

Wrapping Native Libraries

Rhino 6 C++ Creating a Library

Step-by-step example for adding C++ DLL to a Python script

Sample Solution - Moose

– Dale

11 Likes

Any news if there will be C++ sdk for mac?

We have no plans for a C++ SDK on Mac.

1 Like

This does not seem to have opennurbs.h included?

Where is the dislike button? :wink:

1 Like

RhinoSdk.h includes the correct opennurbs headers for you.

2 Likes