【发布时间】:2020-01-27 03:29:58
【问题描述】:
我在 cygwin 上运行堆栈版本 2.1.3、x86_64 hpack-0.31.2。我正在尝试构建的 Haskell 项目需要使用 regex-pcre-0.94.4,而这又需要 pcre 库。我得到的确切信息是:
$ stack build
regex-pcre> configure
regex-pcre> Configuring regex-pcre-0.94.4...
regex-pcre> Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe: Missing dependency
on a foreign library:
regex-pcre> * Missing C library: pcre
regex-pcre> This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is already
installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
似乎没有一种简单的方法可以为 Windows 获取相对较新版本的 pcre 二进制文件(http://gnuwin32.sourceforge.net/packages/pcre.htm 的二进制文件对我来说太旧了)。有一段视频展示了如何从源代码构建二进制文件,但在我走这条路之前,https://github.com/dragokas/PCRE 上提供了一些相对较新的预编译二进制文件,但我不知道如何处理它们或将它们放置在哪里。这开始看起来像很多工作,我想知道它是否值得,或者我应该放弃在 Windows 中做这件事的想法并转向 Linux。有什么想法或建议吗?
PS。我还注意到 cygwin 已经有一个 pcre 库(/bin/cygpcre2-16-0.dll)。但由于这看起来像一个 16 位库,我认为它不会工作,而且我不知道如何告诉堆栈使用它。
【问题讨论】:
标签: cygwin pcre haskell-stack