OpenNurbs build failed

Hello, I was trying to build OpenNurbs C++ project at “GitHub - mcneel/opennurbs: OpenNURBS libraries allow anyone to read and write the 3DM file format without the need for Rhino.”, following the guide at “Getting Started with C/C++” .
As the guide mentions I installed OpenNurbs SDK at “C:\opennurbs-7.6.21127.19001”, and added these lines at stdafx.h .

// defining OPENNURBS_PUBLIC_INSTALL_DIR enables automatic linking using pragmas
#define OPENNURBS_PUBLIC_INSTALL_DIR "C:/opennurbs-7.6.21127.19001"
// uncomment the next line if you want to use opennurbs as a DLL
//#define OPENNURBS_IMPORTS
#include "C:/opennurbs-7.6.21127.19001/opennurbs_public.h"

Then I rebuilded all at Visual Studio, but faced these errors.

|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|zlib|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|—|—|—|—|—|—|—|
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Error|C1083|Cannot open include file: ‘stddef.h’: No such file or directory|zlib|C:\Users\yjbong\Desktop\opennurbs\zlib\zutil.h|21||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|opennurbs_public|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|opennurbs_public_staticlib|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|opennurbs_public|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|opennurbs_public_staticlib|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|example_brep|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|example_read|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|example_userdata|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|example_write|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_read|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_brep|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_userdata|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|example_test|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_read|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_userdata|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_write|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_write|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_test|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||
|Warning|MSB8003|The WindowsSDKDir property is not defined. Some build tools may not be found.|example_convert|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets|501||
|Error|C1083|Cannot open include file: ‘SDKDDKVer.h’: No such file or directory|example_convert|C:\Users\yjbong\Desktop\opennurbs\opennurbs_windows_targetver.h|40||

Could you let me know how to fix build error?

Thanks in advance.

Hi @yj24.bong,

A simple console application seems to work here:

#include <iostream>

#define OPENNURBS_PUBLIC_INSTALL_DIR "/dev/support/opennurbs"
#define OPENNURBS_IMPORTS
#include "/dev/support/opennurbs/opennurbs_public.h"

int main()
{
  std::cout << "OpenNURBS Version " << ON::Version() << " \n";
}

I’m using Visual Studio 2019.

Did you build openNURBS?

– Dale

Oh, I just extracted sdk zip file (opennurbs-7.6.21127.19001.zip) .
Should I build openNURBS sdk using makefile in it?

Open opennurbs_public.sln in Visual Studio, select the platform and configuration, and rebuild all.

– Dale

I’ve installed some features via Visual Studio Installer then all errors disappeared.

  • Windows Universal CRT SDK
  • Windows 10 SDK(10.0.16299.0)
  • Latest v142 x64/x86 C++ ATL build tools
  • Latest v142 x64/x86 C++ MFC build tools
  • MSVC v142 - VS 2019 C++ x64/x86 build tools

Thank you!