Cant install glib on Windows when trying to install gtk3 using cabal - haskell

I have been trying to install gtk3 with cabal, following instructions on https://wiki.haskell.org/Gtk2Hs/Installation , with the exception I have replace gtk with gtk3, I downloaded the all in one bundle of gtk 3.6.4 (from: http://www.tarnyko.net/dl/gtk.htm) unzip it and added the location_of_files/bin to my path, running pkg-config --cflags gtk+-3.0 works ok, cabal install gtk2hs-buildtools correctly installs, but cabal install gtk3 stops with:
Resolving dependencies...
Configuring glib-0.13.4.1...
Failed to install glib-0.13.4.1
Build log ( C:\Users\User\AppData\Roaming\cabal\logs\glib-0.13.4.1.log ):
cabal: Entering directory 'C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1'
[1 of 1] Compiling Main ( C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1\dist\setup\setup.hs, C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1\dist\setup\Main.o )
Linking C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1\dist\setup\setup.exe ...
Configuring glib-0.13.4.1...
setup.exe: Missing dependency on a foreign library:
* Missing C library: intl
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: Leaving directory 'C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1'
And the gtk bundle I download have a libintl.h file in the include folder and a dll in the bin folder, I tried placing the files in almost every location I could think of but to no avail, i can’t think of anything else.
More details: I am running windows 7 x64 with haskell-platform 8.0.2 x64, and I really need this to work under windows for a project I am working.

I manage to install gtk by following the instruction in https://www.gtk.org/download/windows.php, installing MSYS2 and using pacman to install gtk library, ignoring only step 4. After installing the libraries I added to my path C:\msys64\mingw64\bin, and cabal finally compiled gtk3.
I did not like this solution cause it is one more mingw installation on my pc.

Related

Haskell cabal install wx: missing C library wx_gtk2u_webview-3.0

I am trying to install wx by cabal install wx
Configuring wxc to build against wxWidgets 3.0
setup: Missing dependency on a foreign library:
* Missing C library: wx_gtk2u_webview-3.0
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: Error: some packages failed to install :
wx-0.92.0.0 depends on wxc-0.92.0.0 which failed to install.
wxc-0.92.0.0 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.92.0.0 depends on wxc-0.92.0.0 which failed to install.
but I have following files in /usr/lib :
/usr/lib/libwx_gtk2u_webview-3.0.so
/usr/lib/libwx_gtk2u_webview-3.0.so.0
/usr/lib/libwx_gtk2u_webview-3.0.so.0.2.0
I have also tried cabal install --extra-lib-dirs=/usr/lib/ wx but to no avail.
I have also tried all the suggestions in cabal install wx Missing C library
I am on archlinux and I have both wxgtk-3.0 and wxgtk-2.8 multilib and normal versions. I also tried reinstalling them.
I just ran into the same problem on Arch; when I tried running cabal with --verbose=3, it looked like libwx_gtk2u_webview-3.0 was present, but it was complaining about libwebkitgtk-1.0 being missing. After I installed the webkitgtk2 package, which provides libwebkitgtk-1.0, wxHaskell installed with no problems.
Try "sudo apt-get install libwxgtk-webview3.0-dev". It worked for me.

Haskell cabal install: missing C library iw

I'm running Fedora 19 x64, and
I'm trying to install xmobar via cabal install. After installing a bunch of dependencies, I'm stuck at
cabal: Missing dependency on a foreign library:
* Missing C library: iw
I can't find anything about this iw library and I'm a bit lost at how to continue.
I've got all of the standard c libs installed, as far as I can tell.
sudo yum install glibc-common glibc glibc-devel glibc-headers glibc-utils glibc-devel glib2-devel gcc-c++ gcc
Loaded plugins: auto-update-debuginfo, langpacks, refresh-packagekit
Package glibc-common-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-devel-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-headers-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-utils-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-devel-2.17-18.fc19.x86_64 already installed and latest version
Package glib2-devel-2.36.3-3.fc19.x86_64 already installed and latest version
Package gcc-c++-4.8.1-1.fc19.x86_64 already installed and latest version
Package gcc-4.8.1-1.fc19.x86_64 already installed and latest version
Nothing to do
Under Ubuntu the same workaround:
cabal: Missing dependency on a foreign library:
* Missing C library: iw
was resolved though I thought that it can be also two libraries for C language build tools:
liwc : Tools for manipulating C source code
iwyu : Analyze #includes in C and C++ source files
after these additions & libiw-dev library new xmobar was compiled.
Libraries are packaged differently by your OS. For fedora, if you're missing library A, you often will find packages named libA and libA-devel. Luckily, you don't need to guess - instead just ask yum what packages has some file of interest. Below, I asked about the shared object file libiw.so.
yum whatprovides *libiw.so*
...
1:wireless-tools-devel-29-9.1.fc19.x86_64 : Development headers for the
: wireless-tools package
Repo : fedora
Matched from:
Filename : /usr/lib64/libiw.so
1:wireless-tools-29-9.1.fc19.x86_64 : Wireless ethernet configuration tools
Repo : installed
Matched from:
Provides : libiw.so.29()(64bit)
Filename : /lib64/libiw.so.29
I'm surprised Fedora would install without these packages, but if that's the case then obtaining the packages is just a yum install command away.
For anyone trying to install xmobar through cabal on arch,
the missing package that includes iw is called wireless_tools.
You can install that with
pacman -S wireless_tools

Installing svgcairo on windows

I have managed to install cairo, but when I run cabal install svgcairo I get the following error:
setup.exe: The pkg-config package librsvg-2.0 version >=2.16.0 is required but it could not be found.
I'm on windows 8 x64, with cabal version 1.16.02 and ghc 7.6.3.
You need to install librsvg in a location that ghc can find first. Check out http://librsvg.sourceforge.net/download/ for downloads, but you might have to build it from source yourself, which is beyond the scope of this answer. Then just make sure that wherever you've installed the library is on your path and that pkg-config can find it, and you should be good to go.

installing text-icu on Mac OSX with cabal

I want to try unicode with haskell, and the Data.Text docs say I need text-icu. This is what I tried:
Mac OS X 10.6.8
~/haskell_programs$ cabal update
Downloading the latest package list from hackage.haskell.org
~/haskell_programs$ cabal install text-icu
Resolving dependencies...
Downloading text-icu-0.6.3.5...
Configuring text-icu-0.6.3.5...
cabal: Missing dependencies on foreign libraries:
* Missing C libraries: icui18n, icudata, icuuc
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
Failed to install text-icu-0.6.3.5
cabal: Error: some packages failed to install:
text-icu-0.6.3.5 failed during the configure step. The exception was:
ExitFailure 1
I found a post by a Windows user who had the same problem. Do I really need to go out and install those C libraries? Or are they 'misplaced' somewhere on my system?
Thanks.
If you have are using Homebrew, then this is the command that I use:
DYLD_LIBRARY_PATH=/usr/local/opt/icu4c/lib \
cabal install text-icu \
--extra-include-dirs=/usr/local/opt/icu4c/include \
--extra-lib-dirs=/usr/local/opt/icu4c/lib

Can't install cairo with cabal on Windows - how to get pkg-config on win?

Configuring cairo-0.12.0...
setup.exe: The program pkg-config version >=0.9.0 is required but it could not
be found.
cabal: Error: some packages failed to install:
cairo-0.12.0 failed during the configure step. The exception was:
ExitFailure 1
so how can I get pkg-config on windows or how to install cairo then ?
Do you have the cairo development files installed? Recall this isn't the same as having a cairo dll! See the Windows section of their download page for binaries. Also, you can run cabal install -v for more verbosity in the error (which you should post if you're still stuck).
you need to add "C:\Program Files\Gtk+\bin" enclosed in double quotes to PATH system variable so that pkg-config becomes visible to windows, you have to have the gtk+ installed first of course ...

Resources