Error when linking OpenNURBS with C++: can't open "freetype263.lib"

Hi,

I have the following error when building a C++ project that has OpenNURBS linking:

LINK : fatal error LNK1104: cannot open file 'C:/Users/PabloGarcia-Amorena/Documents/opennurbs/bin/x64/Release/freetype263.lib'

All projects in OpenNURBS repository are successfully compiled (Windows SDK 10.0.18362.0 and Visual Studio 2017 (v141)).

To link OpenNURBS, I do the following in the C++ project:

  • In Configuration Properties -> VC++ Directories -> Include Directories add C:/Users/PabloGarcia-Amorena/Documents/opennurbs
  • In Configuration Properties -> Linker -> General -> Additional Library Directories add C:\Users\PabloGarcia-Amorena\Documents\opennurbs\bin\x64\Release
  • In Configuration Properties -> Linker -> Input -> Additional Dependencies add opennurbs_public.lib (here I’ve tried also with opennurbs_public_static.lib and zlib.lib).
  • In stdafx.h add
#define OPENNURBS_PUBLIC_INSTALL_DIR "C:/Users/PabloGarcia-Amorena/Documents/opennurbs"
// uncomment the next line if you want to use opennurbs as a DLL
//#define OPENNURBS_IMPORTS
#include "C:/Users/PabloGarcia-Amorena/Documents/opennurbs/opennurbs_public.h" 

The C++ project is also compiled against Windows SDK 10.0.18362.0 and Visual Studio 2017 (v141).

Do you know what could go wrong, or where the file freetype263.lib is?

Thank you,
Pablo

Hi @Pablo_Garcia-Amorena,

Where did you get openNURBS? What version are you building against? Are you trying to static link or dynamic link?

Thanks,

– Dale

Hi @dale,

It’s the version I found here https://github.com/mcneel/opennurbs for Release x64. I’m trying static link.

For static linking the project should link opennurbs_public_staticlib.lib and zlib.lib instead of opennurbs_public.lib, right?

Pablo

Hi @dale,

I found this: if I remove step

then the C++ project compiles and links OpenNURBS statically properly! Is this step important for some reason?
Seems like opennurbs_public.h gives an issue when linking statically.

For this case I linked opennurbs_public_staticlib.lib and zlib.lib.

Pablo

Hi @Pablo_Garcia-Amorena,

If you examine the example projects, included with the toolkit, you will see that they all have imported the opennurbs_msbuild.Cpp.props property sheet, and they all include opennurbs_public_examples.h which including linking pragmas.

Does this help?

– Dale

Thanks @dale, it did help.

Pablo