问题
While trying to cabal install gd
I encountered the following error
Configuring gd-3000.7.3...
cabal: Missing dependencies on foreign libraries:
* Missing (or bad) header file: gd.h
* Missing C libraries: gd, png, jpeg
This problem can usually be solved by installing the system packages that provide these libraries (you may need the "-dev" versions). ...
It says Missing C libraries: gd, png, jpeg
I guess I am right if I interpret it as: the missing libraries are some unspecified version of: libgd
, libpng
, libjpeg
and their -dev versions
.
We see that here cabal didn't report anything about the versions of these libraries, and thus it is difficult to figure out which version of the foreign libraries does it require.
I read the gd.cabal
from the hackage site
there is a line which says:
Extra-libraries: gd, png, z, jpeg, m, fontconfig, freetype, expat
But this also doesn't say anything about the versions of the foreign libraries.
Is there some location where such information is available (but cabal ignores it or I don't know the correct switch)? Is there any cabal switch I need to turn on for this? or is it the case that cabal is at the mercy of the developer of that package, who may or may not include information about the versions of the foreign libraries?
I wish to get a more general answer, not specific to this cabal install gd
problem only.
Sorry for multiple questions, but I think they are related.
来源:https://stackoverflow.com/questions/32303708/haskell-how-to-resolve-cabal-error-missing-dependencies-on-foreign-libraries