First, many thanks for making openNURBS available. I have made several tweaks to the sources and makefiles so as to compile OpenNURBS with the Nuwen mingw compiler (64 bit Windows 10). The library is built successfully, however, a link error is encountered when trying to build “example_read”. Specifically, I get the following undefined references:
ON_Font::GetInstalledWindowsDWriteFonts
ON_Font::FontStretchFromDWriteStretch
ON_WindowsDWriteGetGlyphMetrics
ON_WindowsDWriteGetFontMetrics
ON_WindowsDWriteGetGlyphOutline
I have checked that opennurbs_font.o is compiled and linked into the library; attempts at changing the link order of the libs did not resolve the issue. I am hoping that an OpenNURBS developer might have a suggestion for a fix. Output at the link stage is:
C:/DEV/JCB/bin/g++ example_read/example_read.o example_userdata/example_ud.o -L. -lopennurbs_public -lfltk -lfltk_forms -lfltk_images -lfltk_cairo -lfltk_jpeg -lpng12 -lz -lglu32 -lopengl32 -lmingwex -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lcomctl32 -lwsock32 -lwinmm -lshlwapi -ldwrite -lrpcrt4 -lpthread -lm -o example_read/example_read
c:/dev/jcb/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ./libopennurbs_public.a(opennurbs_font.o): in function `ON_ManagedFonts::Internal_GetWindowsInstalledFonts(ON_SimpleArray<ON_Font const*>&)':
C:\DEV\NSX_3\openNURBS\openNURBS-7.x/opennurbs_font.cpp:1566: undefined reference to `ON_Font::GetInstalledWindowsDWriteFonts(wchar_t const*, bool, bool, ON_SimpleArray<ON_WindowsDWriteFontInformation>&)'
c:/dev/jcb/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ./libopennurbs_public.a(opennurbs_font.o): in function `ON_Font::ON_Font(ON_Font::FontType, ON_WindowsDWriteFontInformation const&)':
C:\DEV\NSX_3\openNURBS\openNURBS-7.x/opennurbs_font.cpp:8823: undefined reference to `ON_Font::FontStretchFromDWriteStretch(unsigned int, ON_Font::Stretch)'
c:/dev/jcb/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ./libopennurbs_public.a(opennurbs_font.o): in function `ON_ManagedFonts::GetGlyphMetricsInFontDesignUnits(ON_Font const*, unsigned int, ON_TextBox&)':
C:\DEV\NSX_3\openNURBS\openNURBS-7.x/opennurbs_font.cpp:11927: undefined reference to `ON_WindowsDWriteGetGlyphMetrics(ON_FontGlyph const*, ON_TextBox&)'
c:/dev/jcb/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ./libopennurbs_public.a(opennurbs_font.o): in function `ON_ManagedFonts::GetFontMetricsInFontDesignUnits(ON_Font const*, ON_FontMetrics&)':
C:\DEV\NSX_3\openNURBS\openNURBS-7.x/opennurbs_font.cpp:11975: undefined reference to `ON_WindowsDWriteGetFontMetrics(ON_Font const*, ON_FontMetrics&)'
c:/dev/jcb/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ./libopennurbs_public.a(opennurbs_glyph_outline.o): in function `ON_FontGlyph::GetOutline(bool, ON_Outline&) const':
C:\DEV\NSX_3\openNURBS\openNURBS-7.x/opennurbs_glyph_outline.cpp:2973: undefined reference to `ON_WindowsDWriteGetGlyphOutline(ON_FontGlyph const*, ON_OutlineFigure::Type, ON_Outline&)'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:893: example_read/example_read] Error 1
I have ensured that the correct #defines are set with regard to my compiler, (for example, the freetype option and sources are ommitted). I have a hunch that I’m missing something basic here (I have not used dwrite before). Any ideas would be greatly appreciated.
Sincerely,
Nicholas Shea.