Chlumsky / msdfgen

Multi-channel signed distance field generator
MIT License
3.9k stars 404 forks source link

Using vcpkg leads to compiler error in VS2022 #186

Closed Murk42 closed 10 months ago

Murk42 commented 1 year ago

When using vcpkg to manage the msdfgen library, including it yields compiler errors. MSDFGEN_PUBLIC is not defined inside the "generator-config.h" file. And the static variables msdfgen::ErrorCorrectionConfig::defaultMinDeviationRatio and msdfgen::ErrorCorrectionConfig::defaultMinImproveRatio aren't implemented. Here are the errors but i don't think they are anything meaningfull: Capture

Chlumsky commented 1 year ago

I am assuming that you use vcpkg directly in Visual Studio and don't use CMake to generate your project and link MSDFgen. I don't use it this way so I don't know what the correct solution here is, but the problem is that the MSDFgen library exports some global defines for projects that depend on it (this is normally handled by CMake). Those are:

Murk42 commented 1 year ago

@Chlumsky Yeah you got everything right, thank you for the reply! :)

amadeusCaleb commented 11 months ago

@Chlumsky I also had the same issue and was able to resolve it following the directions above.

P.S. thank you for making this library!

Chlumsky commented 10 months ago

This issue should be fixed in version 1.11.