sjshuck / hs-pcre2

Complete Haskell binding to PCRE2
Apache License 2.0
12 stars 2 forks source link

package.yaml: Ensure PCRE2_STATIC=1 is defined #2

Closed chenxiaolong closed 3 years ago

chenxiaolong commented 3 years ago

When the pcre2 library is compiled, config.h gets included, which defines PCRE2_STATIC=1. However, when compiling the test suite, config.h is not loaded, PCRE2_STATIC is undefined, so pcre2.h defaults to specifying the __declspec(dllimport) attribute on all the public API functions. It'll try to link against __imp_<symbol>, which won't exist because pcre2 is a static library.

Fixes: #1

Signed-off-by: Andrew Gunnerson chillermillerlong@hotmail.com

sjshuck commented 3 years ago

Fantastic @chenxiaolong! Thanks for the explanation too.