# Simple way to integrate openNURBS into GH project

**URL:** <https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547>\
**Category:** Rhino Developer\
**Tags:** windows, opennurbs, gh, cpp\
**Created:** [February 27, 2023, 4:16pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547 "2023-02-27T16:16:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xliotx](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/xliotx/32/520428_2.png) [@xliotx](https://discourse.mcneel.com/u/xliotx)\
**Post date:** [February 27, 2023, 4:16pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/1 "2023-02-27T16:16:21Z")

</div>

This problem has been hovering above me for a while.  
I’m writing a GH plugin that needs integration of `cpp` for data processing.  
I need to transfer RhinoCommon data structures, mainly `Point3d`, `Mesh`, etc. (basic types) and don’t want to use the `Marshall` approach.

So I decided to use the recommend PInvoke approach to bind managed/unmanaged code.

While all the tutorial recommended me to download **Rhino SDK** and start a Rhino plugin using the setup wizard, I don’t actually need a setup as complex as that – I just need to integrate some basic `opennurbs` types so that I can wrap Rhino object and send it to the cpp side.

I also tried to use the `opennurbs_public` repo from github, but simply using it as a library always create linking issues, like here: [Freetype263 issue](https://discourse.mcneel.com/t/freetype263-issue/139641)

Simply put, is there a way to simply use Rhino’s internal opennurbs as a library for this task? If yes, how?  
I’ve created another post about this issue: [Using openNURBS lib in a cpp/c# mixed Grasshopper Component - #10 by dale](https://discourse.mcneel.com/t/using-opennurbs-lib-in-a-cpp-c-mixed-grasshopper-component/139640/10)

But I never figure out the setup. Always missing this or that…

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [February 27, 2023, 4:50pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/2 "2023-02-27T16:50:18Z")

</div>

@xliotx,

Grasshopper assemblies should use the version of openNURBS referenced by Grasshopper - the one that comes with Rhino.

Creating a Rhino-dependent DLL is very simple and, yes, involves using the Rhino SDK.

[How to create a Rhino-dependent C++ DLL](https://discourse.mcneel.com/t/how-to-create-a-rhino-dependent-c-dll/139666)

Sample:

[GitHub - dalefugier/Moose: Demonstrates how to share a common library with both a C++ and a C# plug-in.](https://github.com/dalefugier/Moose)

– Dale

---

<div class="post-metadata">

**Author:** ![xliotx](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/xliotx/32/520428_2.png) [@xliotx](https://discourse.mcneel.com/u/xliotx)\
**Post date:** [February 28, 2023, 6:44pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/3 "2023-02-28T18:44:22Z")

</div>

@dale

I followed your post and got these error:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/5/1/951e6cb2f6b800e1a1afe63bee540e907b2f686d.png)

It seems all errors are related to opennurbs from the Rhino 7 SDK.

Well, I just realize that the build is successful, but Intellisense reports all those errors.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [February 28, 2023, 7:43pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/4 "2023-02-28T19:43:10Z")

</div>

Sometimes Intellisense isn’t so…

---

<div class="post-metadata">

**Author:** ![xliotx](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/xliotx/32/520428_2.png) [@xliotx](https://discourse.mcneel.com/u/xliotx)\
**Post date:** [February 28, 2023, 7:48pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/5 "2023-02-28T19:48:37Z")

</div>

> [@Intellisense failure on the Rhino 7 C++ SDK](https://discourse.mcneel.com/t/intellisense-failure-on-the-rhino-7-c-sdk/131607):
>
> Hello - when I worked on the MeshbExporter I noticed that Intellisense apparently has the habit of failing sporadically but drastically even though the build runs fine, when working on a plugin built with the Rhino 7 C++ SDK - anyone happens to know a fix for this? Thx, M In this screenshot, note that the build was successful.

I noticed someone experienced this before.

---

<div class="post-metadata">

**Author:** ![mathias.fuchs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mathias.fuchs/32/510491_2.png) [@mathias.fuchs](https://discourse.mcneel.com/u/mathias.fuchs)\
**Post date:** [March 31, 2023, 11:48am UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/6 "2023-03-31T11:48:26Z")

</div>

Unfortunately, it never did. Maybe clangd/LSP is the way forward, or maybe there is an issue with the order in which Intellisense parses the SDK headers.

---

<div class="post-metadata">

**Author:** ![xliotx](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/xliotx/32/520428_2.png) [@xliotx](https://discourse.mcneel.com/u/xliotx)\
**Post date:** [April 6, 2023, 1:56pm UTC](https://discourse.mcneel.com/t/simple-way-to-integrate-opennurbs-into-gh-project/155547/7 "2023-04-06T13:56:21Z")

</div>

As this is the only lib/SDK I’ve used that have this issue, I would assume that there might be something non-conventional/non-standard inside the SDK…

It is indeed a bit annoying sometimes…
