I'm using MinGW+MSYS,
I've added extra-include-dirs, extra-lib-dirs, but nothing seems to be helping cabal find the pcre library. Here are some command lines I've tried, and some sample output below it.
cabal install pcre-light --extra-include-dirs='C:\Program Files (x86)\GnuWin32\include' --extra-lib-dirs='C:\Program Files (x86)\GnuWin32\lib'
cabal install pcre-light --extra-include-dirs='/C/Program Files (x86)/GnuWin32/include' --extra-lib-dirs='/C/Program Files (x86)/GnuWin32/lib'
cabal install pcre-light --extra-include-dirs="/C/Program Files (x86)/GnuWin32/include" --extra-lib-dirs="/C/Program Files (x86)/GnuWin32/lib"
and I keep getting something along these lines:
Resolving dependencies...
Notice: installing into a sandbox located at C:\Users\user\src\DBSite\dbsite\.cabal-sandbox
Configuring pcre-light-0.4.0.3...
Failed to install pcre-light-0.4.0.3
Last 10 lines of the build log ( C:\Users\user\src\DBSite\dbsite\.cabal-sandbox\logs\pcre-light-0.4.0.3.log ):
[1 of 1] Compiling Main ( C:\Users\user\AppData\Local\Temp\pcre-light-0.4.0.3-9072\pcre-light-0.4.0.3\dist\dist-sandbox-6710ae14\setup\setup.hs, C:\Users\user\AppData\Local\Temp\pcre-light-0.4.0.3-9072\pcre-light-0.4.0.3\dist\dist-sandbox-6710ae14\setup\Main.o )
Linking C:\Users\user\AppData\Local\Temp\pcre-light-0.4.0.3-9072\pcre-light-0.4.0.3\dist/dist-sandbox-6710ae14\setup\setup.exe ...
Configuring pcre-light-0.4.0.3...
setup.exe: Missing dependency on a foreign library:
* Missing C library: 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.
cabal.exe: Error: some packages failed to install:
pcre-light-0.4.0.3 failed during the configure step. The exception was:
ExitFailure 1
I really need to answer this problem since I suppose that a lot of people suffered from it. Just be clear for my system specification: Windows 7 64-bit, GHC 7.8.3 64-bit, cabal 1.20.0.3
Possible failure reasons:
If your GHC is 32-bit you just remove the \\x64 in the above command
I will try to merge the files into the pcre-light package inside it if possible. Good luck
It should be a lot easier to install pcre-light
nowadays on Windows if you do the following:
pcre
package by running pacman -S mingw-w64-i686-pcre
(for 32-bit Windows) or pacman -S mingw-w64-x86_64-pcre
(for 64-bit Windows).pcre-light-0.4.0.4
or later with cabal install pcre-light-0.4.0.4
. (Earlier versions wont't configure the extra dependencies automatically, which would require you to manually set --extra-lib-dirs
and --extra-include-dirs
flags.)That's it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With