I just downloaded the latest opennurbs, opened the opennurbs_public.sln in Visual Studio 2017, and built the solution in all configurations and platforms without warning or error. So in order to be helpful, we are going to need more information. For example, what compiler are you using, etc.?
Visual Studio Enterprise 2017. The Opennurbs public solution builds fine, it’s trying to use the opennurbs_public.lib that has these linking errors. If I switch to try to use the opennurbs_public_staticlib.lib then it only has the first function link error, ModelGeometryFromUnsignedIndex is missing. I also tried to use ModelGeometryFromIndex instead, but link says that is missing too. I can’t find this used in any example. We also use similar LayerFromIndex it looks like it found that okay.
If you use the example_convert in that project and change the cpp file, add the line —
ON_ModelGeometryComponent mg = model.ModelGeometryFromUnsignedIndex(0);
right after if has the message dump->Print(“Successfully read.\n”); , try to rebuild that project and it won’t link. It compiles fine, so that function is defined? But it won’t link.
If you search for it, the only place it finds it is in the header.
D:\Opennurbs_6_1_18014_22401\opennurbs_extensions.h(1252): ON_ModelGeometryComponent ModelGeometryFromUnsignedIndex(
It looks like implementation is missing.
If you search for some of the other similar functions, DimensionStyleFromIndex for example, it finds it, in heade and implementation,
D:\Opennurbs_6_1_18014_22401\opennurbs_extensions.cpp(793):ON_ModelComponentReference ONX_Model::DimensionStyleFromIndex(
D:\Opennurbs_6_1_18014_22401\opennurbs_extensions.h(1158): ON_ModelComponentReference DimensionStyleFromIndex(
Okay, it looks like I can change it to use that. I’m still missing the global objects trying to use the dll library,
1> Creating library x64\Debug\OpenNurbs.lib and object x64\Debug\OpenNurbs.exp
1>GCOpenNurbs.obj : error LNK2001: unresolved external symbol “public: static class ON_Interval const ON_Interval::ZeroToTwoPi” (?ZeroToTwoPi@ON_Interval@@2V1@B)
1>GCOpenNurbs.obj : error LNK2001: unresolved external symbol “public: static class ON_Plane const ON_Plane::World_xy” (?World_xy@ON_Plane@@2V1@B)
1>x64\Debug\GCOpenNurbs.dll : fatal error LNK1120: 2 unresolved externals