在cygwin上使用Haskell Stack的问题--缺少库pcre

问题描述 投票:1回答:1

我在cygwin上运行stack Version 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.netpackagespcre.htm。 对我来说太老了)。) 有一个视频展示了如何从源码编译二进制文件,但在我走这条路之前,有一些相对较新的预编译二进制文件可以在 https:/github.comdragokasPCRE。 但我不知道该怎么处理它们,也不知道该把它们放在哪里。这开始看起来像一个很大的工作,我想知道它是否值得,或者我应该放弃在Windows中做它的想法,并转移到Linux。有什么想法或建议吗?

PS. 我还注意到cygwin已经有一个pcre库(bincygpcre2-16-0.dll),但由于这个库看起来像一个16位库,我认为它不会工作,而且我也不知道如何告诉stack使用这个库。

cygwin pcre haskell-stack
1个回答
0
投票

这里 我找到了答案。

regex-pcre 不支持Windows系统,至少是目前的Windows系统 regex-pcre.cabal 在Windows上工作不顺利。

试试 regex-pcre-builtin就像 regex-pcre,但捆绑了PCRE源。我不知道作者为什么不把它合并到一个新的版本中。regex-pcre但为此创建了一个新的包。

我不得不改变只有名称 regex-pcreregex-pcre-builtin (因为版本管理是一样的)在我的 .cabal 文件,通过堆栈构建安装依赖关系。(例如: ./your-project-name.cabal)

© www.soinside.com 2019 - 2024. All rights reserved.