You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the https://github.com/Ravbug/sdl3-sample, but with the various SDL3, SDL3_ttf, etc updated to current releases or latest, trying to build everything statically on Windows with MSVC. If PlutoSVG is enabled the build fails at link time due to missing plutovg and plutosvg symbols. Everything works if I'm using shared libs, or if I build static libs but plutosvg is not enabled.
I noted that harfbuzz and freetype both mark their function definitions as extern, so I added that to plutosvg/plutovg function declarations and it didn't fix it. Then I realized that the source code is getting directly included in the SDL_ttf build, rather than linking against the plutosvg.lib or whatever, and saw that plutosvg/plutovg check for PLUTOSVG_BUILD_STATIC and PLUTOVG_BUILD_STATIC to detect static builds. So in the CMakeLists.txt for SDL_ttf, where it's adding the plutosvg source and headers for static builds, I added those defines for the SDL_ttf target, and now it compiles and runs fine.
I didn't dive any further than that though, could be missing something else as well to work correctly when building statically.
The text was updated successfully, but these errors were encountered:
I'm using the https://github.com/Ravbug/sdl3-sample, but with the various SDL3, SDL3_ttf, etc updated to current releases or latest, trying to build everything statically on Windows with MSVC. If PlutoSVG is enabled the build fails at link time due to missing plutovg and plutosvg symbols. Everything works if I'm using shared libs, or if I build static libs but plutosvg is not enabled.
I noted that harfbuzz and freetype both mark their function definitions as extern, so I added that to plutosvg/plutovg function declarations and it didn't fix it. Then I realized that the source code is getting directly included in the SDL_ttf build, rather than linking against the plutosvg.lib or whatever, and saw that plutosvg/plutovg check for PLUTOSVG_BUILD_STATIC and PLUTOVG_BUILD_STATIC to detect static builds. So in the CMakeLists.txt for SDL_ttf, where it's adding the plutosvg source and headers for static builds, I added those defines for the SDL_ttf target, and now it compiles and runs fine.
I didn't dive any further than that though, could be missing something else as well to work correctly when building statically.
The text was updated successfully, but these errors were encountered: