Reputation: 3
I am planning on using Open Scene Graph for an open world game project in C++. However, I am having difficulty compiling the library with TTF and PNG plugins (using freestyle and libpng respectively) on the latest MinGW. The documentation for this seems very sparse.
For simplicity, I will just talk about freetype. Having just compiled it using Cmake and mingw32-make, it resides in Dependencies/freetype
with the compiled .a
in Dependencies/freetype/build
, and an empty header file (that in itself warrants an explanation) in the include sub folder of the build directory.
I would like to know which environmental variables to set to where or where to copy the compiled output for them to be included in OSG's build.
Upvotes: 0
Views: 972
Reputation: 76609
You can avoid having to compile openscenegraph and other dependencies if you use the packages available from the MSYS2 package repository. Although you may not be interested in a Unix shell environment, you can still use MSYS2 as a general package management system, with a plethora of packages available.
In your case, it's as easy as calling:
pacman -Sy mingw-w64-{i686,x86_64}-openscenegraph mingw-w64-{i686,x86_64}-gcc
Which will install GCC and Openscenegraph, with all required dependencies in <MSYS2_INSTALL_DIR>/mingw{32,64}/
.
If you are still interested in compiling everything from source, look at the build scripts to build the aforementioned packages, conveniently located on github (in your case, look for mingw-w64-openscenegraph
). The PKGBUILD files contain dependencies, and the build steps. You can build the packages yourself by downloading the PKGBUILD (and the other files alongside it, which are used in the build process), and run makepkg-mingw
from the MSYS2 shell in the directory where you put the PKGBUILD file. This is by far the easiest way to build something for Windows using GCC.
Upvotes: 1