rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.65k stars 266 forks source link

Building on Windows according to instructions fails #211

Closed ghost closed 5 years ago

ghost commented 5 years ago

I tried following the installation instructions to build the latest master version of freetype-gl on 64-bit Windows, with MSYS2 MINGW64 and 64-bit gcc toolchain. I could not get it to work initially; here are the problems I encountered:

  1. It seems asking CMake to build "MinGW Makefiles" as per instructions does not work in the Mingw64 console, as it recognizes "sh" to be available. Switching to using "MSYS Makefiles" seems to work, understandably so. I suggest changing the Installation Instructions to reflect this, unless this is because of my specific setup.

  2. When attempting to build the harfbuzz demo, the linker errors, claiming an undefined reference to 'strndup' from vertex-buffer.c and vertex-attribute.c inside the previously built libfreetype-gl-hb.a. This function's implementation should be provided by platform.c, but it seems that file is not included when building the -hb.a file. Simply adding platform.c to FREETYPE_GL_HB_SRC in harfbuzz/CMakeLists.txt solved the problem for me, so I suggest changing this as well.

I apologize if this issue isn't formatted correctly, or if I should have made a PR instead, as I'm new to GitHub.

rougier commented 5 years ago

Thanks for the report. Could you make a PR with your proposed fix for the harfbuzz demo ?

ghost commented 5 years ago

Done.