Reputation: 688
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
Upvotes: 6
Views: 1667
Reputation: 141
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!
Upvotes: 2
Reputation: 3346
I just ran into the very same problem. I downloaded Haskell-Platform 32bit (version 7.10 at the time of writing), and unzipped pcre-7.0-lib.zip
which i got from the gnuwin project on sourceforge
cabal install pcre-light --extra-include-dirs=C:\temp\pcre-7.0-lib\include --extra-lib-dirs=C:\temp\pcre-7.0-lib\lib
So, i did no escaping of the backslashes and i also did not quote the string. I did also not rename the contents in the zipfile.
I should mention that it was executed from a cmder-shell which adds a few unix tools to the path. With a plain cmd.exe, i get a warning because Cygwin or MinGW/MSYS is required.
Upvotes: 0
Reputation: 405
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
Upvotes: 6