Linking errors in VS2017 with v6 libs


We have been using the opennurbs v5 libs to read .3dm files to our software (which worked fine) and we are trying now to migrate to v6. After compiling v6 libs (both shared and static, again with success under VS2017) we tried to use our old code to link with the new libs which failed with some linking errors (no compiler errors at all). Trying to figure out what’s wrong we consulted the online documentation of the API from this page:

First of all, is this the correct section of the documentation? One thing we struggled with is that there is no clear distinction between Opennurbs and the Rhino SDK at least on the documentation side.
Secondly, one of the unresolved symbols was the ONX_Model::GetRenderMaterial function that seems to be obsolete in the new version. Trying to find out if there is a replacement, we stumbled upon the ONX_Model::RenderFromIndex function in this page:
However, in the explanation of the function there is no description (possibly because it seems self explanatory) and in the description of the similar function ONX_Model::RenderMaterialFromLayerIndex there is a text that describes the ONX_Model::RenderMaterialFromAttributes argument and also includes an argument that is not there in the definition (material).
This whole situation creates some confusion and a lack of trust for the documentation.

Can you please comment on these?

Thanks in advance

Hi @gp1

No, the version of openNURBS used by Rhino is not the same as the free, open-source version of openNURBS you can build yourself.

My guess is your really looking for ONX_Model::RenderMaterialFromAttributes, which will call the correct member function based on ON_3dmObjectAttributes.MaterialSource().

const ON_ModelComponentReference& model_component_ref = model.RenderMaterialFromAttributes(attributes);
if (!model_component_ref.IsEmpty())
  const ON_Material* material = ON_Material::FromModelComponentRef(model_component_ref, &ON_Material::Default);
  if (nullptr != material)
    // TODO...

– Dale

Thanks for the feedback. I will try that and see how it goes. However, the question remains: which is the correct documentation for the free version of the opennurbs library? There is no documentation in the opennurbs-v6 zip file. This is not the only linking error and it would be inconvenient to create a post for every single one of them.

Best regards

Hi @gp1,

You can use the documention you referenced. Keep in mind that will run across classes and functions that exist in the documentation that do not exist in the free openNURBS toolkit. Also, the help is auto-generated by Doxygen, so it is what it is.

– Dale

Is there a documentation link for the V5 of opennurbs? I could use that as a reference.

From here:

Click the Looking for the older Rhino 5 version? link at the top.

Then click the API link at the top.

Then click the C++ API Docs (Rhino for Windows) link.

– Dale

Great. Thanks a lot.