Opennurbs library dependencies

Hello,

I developed a Rhino plug-in which, of course, depends from full opennurbs.dll version (the one delivered with Rhino, capable to manipulate geometries).
Now I have to add a new dependency from an other dll (called core.dll), developed by an other team of my company, which depends by the free opennurbs.dll version (the open source one, which is limited).

core.dll cannot depends by the full opennurbs.dll version because it is used also by applications running outside Rhino.

I would like to know if I have to deploy my plug-in with both the opennurbs.dll versions or if it is possible to build core.dll with the free version and let it load the full version in production.
If this second scenario is allowed, what should pay attention to? Should I make sure some free opennurbs building parameters to be in a particular way?

Thank you and best regards,
Alberto

so you want the same build to use the limited dll when used without rhino and the extended(licensed) one when using with rhino?

On top of my head you could make two different builds. Alternatively you can try to intercept the call when looking for the dll. My experience is that it is not 100% safe, becasue you can only intercept if your code has been read, so if another plugin opens one of the dlls in the same app before reading your code, then the intercept will not work.

Once a dll is loaded in an app, afaik, you cannot load that same dll again. (same problem with different versions.. ive had a dependency on json 10 but rhino uses json 8. rhino loads json8 before my plugin runs so i cant do anything about it. i had to rewrite a lot and use other libraries to avoid the json10 reference).

It can look something like this:

Edit: Oh didnt see you are in cpp.

Hello Mathias,
yes I work with c++.

I don’t need to intercept the call when looking for the dll because at the moment I simply work with dlls with different names. opennurbs.dll (licensed) and my_free_opennurbs.dll (free and built by my work mate).

I simply would like to know if it possible to use licensed version on a library buily using the open source limited version.
Watching at the headers files, it seems that the licensed version is an extension of the free version, but I’m not sure i can safely try the trick.

But if your Rhino plugin is meant to run in Rhino, Rhino will have access to the full opennurbs. Why to you want to use the open source version of opennurbs in Rhino? This will break some functionality in Rhino.

I don’t want to use open source version.

I want to:

  • build my plug-in with the full opennurbs;
  • build core.dll with the open source opennurbs;
  • run Rhino, loading my plugin, loading code.dll and let all of them to use the full opennurbs.

It would be nice for me to avoid:

  • two different building configurations for core.dll (one for each opennurbs version)
  • add to my plug-in setup the open source opennurbs library

Is it possible to let core.dll to be built with open source opennurbs and run with full opennurbs (which I think to be an extension of the open source version)?

Hi Alberto,

Can you statically link public openNURBS into core.dll?

Seems like building core.dll conditionally - linking with private openNURBS when used in a Rhino plug-in and public openNURBS when used outside of Rhino - might be an option.

– Dale

1 Like

Be aware that public openNURBS and the commercial version that ships with Rhino are not binary compatible. You can’t compile against one and use a different one at runtime without problems

  • Some functions available in the commercial version do not exist in the public version
  • Class sizes can be different
  • VTables are definitely different
1 Like

Yes @dale, I can statically link public openNURBS into core.dll.
I was simply indolent to create different project configurations but if, as reported by @stevebaer, it is not possible, I’ll proceed this way.

Many thanks

1 Like