gtk2hs installation - haskell

hello I got some error
on windows xp sp3,
I tried
install up to date Haskell platform
install gtk+ all in one bundle 2.16
add MinGW's bin address to PATH Environment variables
add GTK+'s bin address to PATH Environment variables
and on CMD
I execute the
cabal update
cabal install gtk2hs-buildtools
so far so good
but when I execute the
cabal install gtk
the error arise
here's dump
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\dreambook>cabal install gtk
Resolving dependencies...
C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0.12.0808\cairo-0.12.0\Gtk2HsSetup.hs:2
5:2: warning: #warning Setup.hs is guessing the version of Cabal. If compilation
of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when buil
ding (prefixed by --ghc-option= when using the 'cabal' command)
[1 of 2] Compiling Gtk2HsSetup ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0
.12.0808\cairo-0.12.0\Gtk2HsSetup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0
.12.0808\cairo-0.12.0\dist\setup\Gtk2HsSetup.o )
[2 of 2] Compiling Main ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0
.12.0808\cairo-0.12.0\Setup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0.12.08
08\cairo-0.12.0\dist\setup\Main.o )
Linking C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0.12.0808\cairo-0.12.0\dist\set
up\setup.exe ...
Configuring cairo-0.12.0...
Preprocessing library cairo-0.12.0...
Building cairo-0.12.0...
[ 1 of 17] Compiling Graphics.Rendering.Cairo.Matrix ( dist\build\Graphics\Rende
ring\Cairo\Matrix.hs, dist\build\Graphics\Rendering\Cairo\Matrix.o )
[ 2 of 17] Compiling Graphics.Rendering.Cairo.Types ( dist\build\Graphics\Render
ing\Cairo\Types.hs, dist\build\Graphics\Rendering\Cairo\Types.o )
[ 3 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Cairo ( dist\buil
d\Graphics\Rendering\Cairo\Internal\Drawing\Cairo.hs, dist\build\Graphics\Render
ing\Cairo\Internal\Drawing\Cairo.o )
[ 4 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Paths ( dist\buil
d\Graphics\Rendering\Cairo\Internal\Drawing\Paths.hs, dist\build\Graphics\Render
ing\Cairo\Internal\Drawing\Paths.o )
[ 5 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Patterns ( dist\b
uild\Graphics\Rendering\Cairo\Internal\Drawing\Patterns.hs, dist\build\Graphics\
Rendering\Cairo\Internal\Drawing\Patterns.o )
[ 6 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Text ( dist\build
\Graphics\Rendering\Cairo\Internal\Drawing\Text.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Drawing\Text.o )
[ 7 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Transformations (
dist\build\Graphics\Rendering\Cairo\Internal\Drawing\Transformations.hs, dist\b
uild\Graphics\Rendering\Cairo\Internal\Drawing\Transformations.o )
[ 8 of 17] Compiling Graphics.Rendering.Cairo.Internal.Fonts.FontOptions ( dist\
build\Graphics\Rendering\Cairo\Internal\Fonts\FontOptions.hs, dist\build\Graphic
s\Rendering\Cairo\Internal\Fonts\FontOptions.o )
[ 9 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.Image ( dist\bui
ld\Graphics\Rendering\Cairo\Internal\Surfaces\Image.hs, dist\build\Graphics\Rend
ering\Cairo\Internal\Surfaces\Image.o )
[10 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.PDF ( dist\build
\Graphics\Rendering\Cairo\Internal\Surfaces\PDF.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Surfaces\PDF.o )
[11 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.PNG ( dist\build
\Graphics\Rendering\Cairo\Internal\Surfaces\PNG.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Surfaces\PNG.o )
[12 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.PS ( dist\build\
Graphics\Rendering\Cairo\Internal\Surfaces\PS.hs, dist\build\Graphics\Rendering\
Cairo\Internal\Surfaces\PS.o )
[13 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.SVG ( dist\build
\Graphics\Rendering\Cairo\Internal\Surfaces\SVG.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Surfaces\SVG.o )
[14 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.Surface ( dist\b
uild\Graphics\Rendering\Cairo\Internal\Surfaces\Surface.hs, dist\build\Graphics\
Rendering\Cairo\Internal\Surfaces\Surface.o )
[15 of 17] Compiling Graphics.Rendering.Cairo.Internal.Utilities ( dist\build\Gr
aphics\Rendering\Cairo\Internal\Utilities.hs, dist\build\Graphics\Rendering\Cair
o\Internal\Utilities.o )
[16 of 17] Compiling Graphics.Rendering.Cairo.Internal ( Graphics\Rendering\Cair
o\Internal.hs, dist\build\Graphics\Rendering\Cairo\Internal.o )
[17 of 17] Compiling Graphics.Rendering.Cairo ( Graphics\Rendering\Cairo.hs, dis
t\build\Graphics\Rendering\Cairo.o )
Registering cairo-0.12.0...
Installing library in C:\Documents and Settings\dreambook\Application
Data\cabal\cairo-0.12.0\ghc-7.0.3
Registering cairo-0.12.0...
setup.exe: internal error: unexpected package db stack: [UserPackageDB]
C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12.0808\glib-0.12.0\Gtk2HsSetup.hs:25:
2: warning: #warning Setup.hs is guessing the version of Cabal. If compilation o
f Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when buildi
ng (prefixed by --ghc-option= when using the 'cabal' command)
[1 of 2] Compiling Gtk2HsSetup ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.
12.0808\glib-0.12.0\Gtk2HsSetup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12
.0808\glib-0.12.0\dist\setup\Gtk2HsSetup.o )
[2 of 2] Compiling Main ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.
12.0808\glib-0.12.0\Setup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12.0808\
glib-0.12.0\dist\setup\Main.o )
Linking C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12.0808\glib-0.12.0\dist\setup
\setup.exe ...
Configuring glib-0.12.0...
Preprocessing library glib-0.12.0...
Building glib-0.12.0...
[ 1 of 20] Compiling System.Glib.Attributes ( System\Glib\Attributes.hs, dist\bu
ild\System\Glib\Attributes.o )
[ 2 of 20] Compiling System.Glib.Flags ( System\Glib\Flags.hs, dist\build\System
\Glib\Flags.o )
[ 3 of 20] Compiling System.Glib.FFI ( System\Glib\FFI.hs, dist\build\System\Gl
ib\FFI.o )
[ 4 of 20] Compiling System.Glib.Types ( dist\build\System\Glib\Types.hs, dist\b
uild\System\Glib\Types.o )
[ 5 of 20] Compiling System.Glib.GList ( dist\build\System\Glib\GList.hs, dist\b
uild\System\Glib\GList.o )
[ 6 of 20] Compiling System.Glib.GType ( dist\build\System\Glib\GType.hs, dist\b
uild\System\Glib\GType.o )
[ 7 of 20] Compiling System.Glib.GValue ( dist\build\System\Glib\GValue.hs, dist
\build\System\Glib\GValue.o )
[ 8 of 20] Compiling System.Glib.GParameter ( dist\build\System\Glib\GParameter.
hs, dist\build\System\Glib\GParameter.o )
[ 9 of 20] Compiling System.Glib.GTypeConstants ( dist\build\System\Glib\GTypeCo
nstants.hs, dist\build\System\Glib\GTypeConstants.o )
[10 of 20] Compiling System.Glib.UTFString ( System\Glib\UTFString.hs, dist\buil
d\System\Glib\UTFString.o )
[11 of 20] Compiling System.Glib.GObject ( dist\build\System\Glib\GObject.hs, di
st\build\System\Glib\GObject.o )
[12 of 20] Compiling System.Glib.GValueTypes ( dist\build\System\Glib\GValueType
s.hs, dist\build\System\Glib\GValueTypes.o )
[13 of 20] Compiling System.Glib.Properties ( dist\build\System\Glib\Properties.
hs, dist\build\System\Glib\Properties.o )
[14 of 20] Compiling System.Glib.StoreValue ( dist\build\System\Glib\StoreValue.
hs, dist\build\System\Glib\StoreValue.o )
System\Glib\StoreValue.hsc:38:1:
Warning: Module `Control.OldException' is deprecated:
Future versions of base will not support the old exceptions style
. Please switch to extensible exceptions.
System\Glib\StoreValue.hsc:38:1:
Warning: In the use of data constructor `AssertionFailed'
(imported from Control.OldException):
Deprecated: "Future versions of base will not support the old excep
tions style. Please switch to extensible exceptions."
[15 of 20] Compiling System.Glib.Signals ( dist\build\System\Glib\Signals.hs, di
st\build\System\Glib\Signals.o )
[16 of 20] Compiling System.Glib.MainLoop ( dist\build\System\Glib\MainLoop.hs,
dist\build\System\Glib\MainLoop.o )
[17 of 20] Compiling System.Glib.GError ( dist\build\System\Glib\GError.hs, dist
\build\System\Glib\GError.o )
System\Glib\GError.chs:93:1:
Warning: Module `Control.OldException' is deprecated:
Future versions of base will not support the old exceptions style
. Please switch to extensible exceptions.
System\Glib\GError.chs:93:1:
Warning: In the use of `catchDyn'
(imported from Control.OldException):
Deprecated: "Future versions of base will not support the old excep
tions style. Please switch to extensible exceptions."
System\Glib\GError.chs:93:1:
Warning: In the use of `throwDyn'
(imported from Control.OldException):
Deprecated: "Future versions of base will not support the old excep
tions style. Please switch to extensible exceptions."
[18 of 20] Compiling System.Glib.GDateTime ( dist\build\System\Glib\GDateTime.hs
, dist\build\System\Glib\GDateTime.o )
[19 of 20] Compiling System.Glib.Utils ( dist\build\System\Glib\Utils.hs, dist\b
uild\System\Glib\Utils.o )
[20 of 20] Compiling System.Glib ( System\Glib.hs, dist\build\System\Glib.o
)
Registering glib-0.12.0...
Installing library in C:\Documents and Settings\dreambook\Application
Data\cabal\glib-0.12.0\ghc-7.0.3
Registering glib-0.12.0...
setup.exe: internal error: unexpected package db stack: [UserPackageDB]
cabal: Error: some packages failed to install:
cairo-0.12.0 failed during the final install step. The exception was:
ExitFailure 1
gio-0.12.0 depends on glib-0.12.0 which failed to install.
glib-0.12.0 failed during the final install step. The exception was:
ExitFailure 1
gtk-0.12.0 depends on glib-0.12.0 which failed to install.
pango-0.12.0 depends on glib-0.12.0 which failed to install.

You're hitting a bug in Gtk2hsSetup.hs, the bug and a workaround is described here.
I would recommend adding yourself to that ticket on the trac so that you'll be notified when a fix becomes available.

Install those packages in the global package directory using the --global option.
For instance: cabal install cairo --global

Related

stack build fails with "Failed to load interface for `Main' no unit id matching `main' was found"

I've been trying to change a project to also provide a library (previous it was just an executable).
The only change has been (to the hpack package.yaml):
+library:
+ source-dirs: src
+ exposed-modules:
+ - CYAva
However now when running stack build I see output of:
2018-12-31 16:32:06.406901: [warn] Failed to load interface for `Main'
2018-12-31 16:32:06.407023: [warn] no unit id matching `main' was found
hpack file:
library:
source-dirs: src
exposed-modules:
- CYAva
executable:
source-dirs: src
main: Main.hs
license-file: LICENSE
build-type: Simple
maintainer: Chris Stryczynski
dependencies:
- base >=4.10 && <4.12
- colour
- data-default-class
# common
- Chart-cairo
- Chart
- lens
- aeson
- bytestring
- stm
- split
- text
- time
- thyme
- binary
- binary-orphans
- old-locale
- directory
- pretty-simple
- string-conversions
- optparse-applicative
name: ceriumyankeeavocado
version: '0.1.0.0'
extra-source-files: ChangeLog.md
author: Chris Stryczynski
license: BSD3
cabal file:
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.31.1.
--
-- see: https://github.com/sol/hpack
--
-- hash: d90f1b53fc8bb74ddff9cf98937222e0c38a20affcd2506880039312e549541f
name: ceriumyankeeavocado
version: 0.1.0.0
author: Chris Stryczynski
maintainer: Chris Stryczynski
license: BSD3
license-file: LICENSE
build-type: Simple
extra-source-files:
ChangeLog.md
library
exposed-modules:
CYAva
other-modules:
Main
Paths_ceriumyankeeavocado
hs-source-dirs:
src
build-depends:
Chart
, Chart-cairo
, aeson
, base >=4.10 && <4.12
, binary
, binary-orphans
, bytestring
, colour
, data-default-class
, directory
, lens
, old-locale
, optparse-applicative
, pretty-simple
, split
, stm
, string-conversions
, text
, thyme
, time
default-language: Haskell2010
executable ceriumyankeeavocado
main-is: Main.hs
other-modules:
CYAva
Paths_ceriumyankeeavocado
hs-source-dirs:
src
build-depends:
Chart
, Chart-cairo
, aeson
, base >=4.10 && <4.12
, binary
, binary-orphans
, bytestring
, colour
, data-default-class
, directory
, lens
, old-locale
, optparse-applicative
, pretty-simple
, split
, stm
, string-conversions
, text
, thyme
, time
default-language: Haskell2010
stack build
thyme-0.3.5.5: configure
thyme-0.3.5.5: build
Chart-1.9: configure
Chart-1.9: build
Chart-1.9: copy/register
Chart-cairo-1.9: configure
Chart-cairo-1.9: build
Chart-cairo-1.9: copy/register
thyme-0.3.5.5: copy/register
Building all executables for `ceriumyankeeavocado' once. After a successful build of all of them, only specified executables will be rebuilt.
ceriumyankeeavocado-0.1.0.0: configure (lib + exe)
Configuring ceriumyankeeavocado-0.1.0.0...
ceriumyankeeavocado-0.1.0.0: build (lib + exe)
Preprocessing executable 'ceriumyankeeavocado' for ceriumyankeeavocado-0.1.0.0..
Building executable 'ceriumyankeeavocado' for ceriumyankeeavocado-0.1.0.0..
[1 of 3] Compiling CYAva ( src/CYAva.hs, .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/ceriumyankeeavocado/ceriumyankeeavocado-tmp/CYAva.o )
[2 of 3] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/ceriumyankeeavocado/ceriumyankeeavocado-tmp/Main.o )
[3 of 3] Compiling Paths_ceriumyankeeavocado ( .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/ceriumyankeeavocado/autogen/Paths_ceriumyankeeavocado.hs, .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/ceriumyankeeavocado/ceriumyankeeavocado-tmp/Paths_ceriumyankeeavocado.o )
Linking .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/ceriumyankeeavocado/ceriumyankeeavocado ...
Preprocessing library for ceriumyankeeavocado-0.1.0.0..
Building library for ceriumyankeeavocado-0.1.0.0..
[1 of 3] Compiling CYAva ( src/CYAva.hs, .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/CYAva.o )
[2 of 3] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/Main.o )
Failed to load interface for `Main'
no unit id matching `main' was found
Completed 4 action(s).
-- While building package ceriumyankeeavocado-0.1.0.0 using:
/home/chris/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1 build lib:ceriumyankeeavocado exe:ceriumyankeeavocado --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
I did not have the following in my Main.hs file:
module Main where
The above changed fixed it..

Haskell reexport linker errors

I want to have a function in a Foo.Internal module that is used by other things in there, but it should also be exposed by the Foo module. When I reexport the function from Foo to use elsewhere I get linker errors. I am using stack to build the code, so it might be an issue there, or with cabal, not sure.
Minimal working example:
module Foo.Internal where
secrets = "stuff"
module Foo(secrets) where
import Foo.Internal (secrets)
module Main where
import Foo
main = putStrLn secrets
When I compile this with stack build I get
package-0.1.0.0: build
Preprocessing library package-0.1.0.0...
[1 of 2] Compiling Foo.Internal ( src/Foo/Internal.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Foo/Internal.o )
[2 of 2] Compiling Foo ( src/Foo.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Foo.o )
In-place registering package-0.1.0.0...
Preprocessing executable 'package-exe' for package-0.1.0.0...
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/package-exe/package-exe ...
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/package-exe/package-exe-tmp/Main.o:(.text+0x26): undefined reference to `packazuEPdwTk5e5ZZOCOiVJMdOJ3P_FooziInternal_secrets_closure'
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/package-exe/package-exe-tmp/Main.o: In function `S2Re_srt':
(.data+0x40): undefined reference to `packazuEPdwTk5e5ZZOCOiVJMdOJ3P_FooziInternal_secrets_closure'
collect2: error: ld returned 1 exit status

Error trying to link with osgText and freetype

I've already checked dozens of web pages and configurations about this.
I'm desperate because I really need to use this feature and soon.
These are my settings:
Language: C++
Libraries: OpenSceneGraph (OSG) v3.2.0
OS: Xubuntu 14.04 (on a VMWare Player virtual machine)
I am compiling an example from the book "OpenSceneGraph 3.0 - Beginner's Guide", pages 297-299, regarding the use of Text on OSG, which requires an additional plug-in, freetype (http://www.freetype.org/), which is installed.
The example compiles correctly.
I think I have all the required include files and libraries.
The problem comes in the link phase. It always gives me this error:
/usr/bin/ld: CMakeFiles/osg_demos.dir/osg_demos.cpp.o: undefined reference to symbol '_ZN7osgText12readFontFileERKSsPKN5osgDB7OptionsE'
//usr/lib/libosgText.so.99: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [osg_demos] Error 1
make[1]: *** [CMakeFiles/osg_demos.dir/all] Error 2
make: *** [all] Error 2
I checked that I have the files:
"/usr/lib/libosgText.so.99" which is a link to the actual lib file:
"libosgText.so.3.2.0".
"/usr/lib/osgPlugins-3.2.0/osgdb_freetype.so"
the external dependency of the osgText library.
I ran out of ideas. :(
Can someone help me?
My question stops here, but in case you want to check my files, please find them below.
The code responsible for this problem:
osgText::Text* createText( const osg::Vec3& pos,
const std::string& content, float size ) {
osg::ref_ptr<osgText::Font> g_font = osgText::readFontFile("arial.ttf");
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont( g_font.get() );
text->setCharacterSize( size );
text->setAxisAlignment( osgText::TextBase::XY_PLANE );
text->setPosition( pos );
text->setText( content );
return text.release();
}
These are the Include files that I am using which are specific to osgText operations, apart from all the others that I already need on my project:
#include <osg/Camera>
#include <osgText/TextBase>
#include <osgText/Font>
#include <osgText/Text>
This is my "CMakeLists.txt" file:
cmake_minimum_required( VERSION 2.6 )
project( OSG_DEMOS )
find_package( OpenThreads )
find_package( osg )
find_package( osgDB )
find_package( osgGA )
find_package( osgUtil )
find_package( osgViewer )
find_package( osgText ) # Needed for demo: writeText()
find_package( osgShadow ) # Needed for demo: writeText()
find_package( osgParticle ) # Needed for demo: writeText()
find_package( osgFX ) # Needed for demo: writeText()
find_package(PCL 1.6 COMPONENTS)
set(CMAKE_CXX_FLAGS "-g -Wno-deprecated")
macro( config_project PROJNAME LIBNAME )
include_directories( ${${LIBNAME}_INCLUDE_DIR} )
target_link_libraries( ${PROJNAME} ${${LIBNAME}_LIBRARIES} )
endmacro()
add_executable(osg_demos osg_demos.cpp)
config_project(osg_demos OPENTHREADS )
config_project(osg_demos OSG )
config_project(osg_demos OSGDB )
config_project(osg_demos OSGGA )
config_project(osg_demos OSGUTIL )
config_project(osg_demos OSGVIEWER )
config_project(osg_demos osgText )
config_project(osg_demos osgShadow )
config_project(osg_demos osgParticle )
config_project(osg_demos osgFX )
The problem was on the "CMakeLists.txt" file.
Apparently, the config_project macro requires all uppercase letters. I don't exactly understand why.
To make the project link correctly, I switched to uppercase the reference to library name on the last four lines of that file, like:
config_project(osg_demos OSGTEXT )
instead of:
config_project(osg_demos osgText )
What a nightmare just because of this...

Problems updating cabal-install v. 1.20.0.3

Problems updating cabal-install v. 1.20.0.3
The following is what I made
C:\Windows\system32>cabal update
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install
C:\Windows\system32>cabal install cabal-install
Resolving dependencies...
Configuring network-2.6.0.2...
cabal: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
Failed to install network-2.6.0.2
cabal: Error: some packages failed to install:
HTTP-4000.2.19 depends on network-2.6.0.2 which failed to install.
cabal-install-1.20.0.4 depends on network-2.6.0.2 which failed to install.
network-2.6.0.2 failed during the configure step. The exception was:
ExitFailure 1
C:\Windows\system32>cabal --v
cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library
After these messages I installed Cygwin64 and tried to reinstall "cabal-install", but nothing changed.
What can I do now? Thank you for your help.
CABAL INFO NETWORK
$ cabal info network
* network (library)
Synopsis: Low-level networking interface
Versions available: 2.3.2.0, 2.4.1.2, 2.4.2.1, 2.4.2.2, 2.4.2.3, 2.5.0.0,
2.6.0.0, 2.6.0.1, 2.6.0.2 (and 39 others)
Versions installed: 2.4.2.3, 2.6.0.2
Homepage: https://github.com/haskell/network
Bug reports: https://github.com/haskell/network/issues
Description: This package provides a low-level networking interface.
In network-2.6 the #Network.URI# module was split off into
its own package, network-uri-2.6. If you're using the
#Network.URI# module you can automatically get it from the
right package by adding this to your .cabal file:
> flag network-uri > description: Get Network.URI from the
network-uri package > default: True > > library > -- ... > if
flag(network-uri) > build-depends: network-uri >= 2.6,
network >= 2.6 > else > build-depends: network-uri < 2.6,
network < 2.6
That is, get the module from either network < 2.6 or from
network-uri >= 2.6.
Category: Network
License: BSD3
Maintainer: Johan Tibell <johan.tibell#gmail.com>
Source repo: git://github.com/haskell/network.git
Dependencies: base >=3 && <5, bytestring <0.11, unix >=2,
test-framework-hunit -any, test-framework -any, network -any,
HUnit -any, bytestring -any, base <5,
test-framework-hunit -any, test-framework -any, network -any,
HUnit -any, bytestring -any, base <5
Documentation: [ Not installed ]
Cached: Yes
Modules:
Network
Network.BSD
Network.Socket
Network.Socket.ByteString
Network.Socket.ByteString.Lazy
Network.Socket.Internal
Following the latest instructions i tried:
I tried:
C:\Windows\system32>cabal install cabal-install --constraint="network==2.4.2.3"
...
Linking dist\build\cabal\cabal.exe ...
Installing executable(s) in C:\Users\Alberto\AppData\Roaming\cabal\bin
Installed cabal-install-1.20.0.4
C:\Windows\system32>cabal --v
cabal-install version 1.20.0.4
using version 1.20.0.2 of the Cabal library
Instead with: cabal install cabal-install -v --constraint="network==2.6.0.2"
These are the last lines:
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid
operation
collect2: ld returned 1 exit status
Failed to install cabal-install-1.20.0.4
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.4 failed during the building phase. The exception was:
ExitFailure 1
The following is the incomplete version of the verbose process. (Incomplete because the Command Prompt window is too little to contain all the lines.) And also the "Body" of this post is "limited to 30000 characters" and I entered 43408.
Linking...
C:\Program Files\Haskell Platform\2014.2.0.0\bin\ghc.exe --make -fbuilding-cabal
-package -O -static -outputdir dist\build\cabal\cabal-tmp -odir dist\build\cabal
\cabal-tmp -hidir dist\build\cabal\cabal-tmp -stubdir dist\build\cabal\cabal-tmp
-i -idist\build\cabal\cabal-tmp -i. -idist\build\autogen -Idist\build\autogen -
Idist\build\cabal\cabal-tmp -optP-DWIN32 -optP-include -optPdist\build\autogen\c
abal_macros.h -hide-all-packages -package-db dist\package.conf.inplace -package-
id Cabal-1.20.0.2-2d0d4b50a80873bd77d7619acdc39282 -package-id HTTP-4000.2.19-a3
b06338bfc05de6b2dff745ab78e8e2 -package-id Win32-2.3.0.2-698249828064ce7d3e73140
6aa0b6536 -package-id array-0.5.0.0-a620a6e52b09b01c2ee52fdc2f35ba14 -package-id
base-4.7.0.1-7c4827d45272c6220486aa798a981cbc -package-id bytestring-0.10.4.0-0
168d7fce99b3d6589c7684c734053d4 -package-id containers-0.5.5.1-08015588ba3fe884f
62b392b72b7a17f -package-id directory-1.2.1.0-8cccd8e1806d43153b63c8c02500965e -
package-id filepath-1.3.0.2-a4d1d9ee29199e7f421cb1e2eeca7b3c -package-id mtl-2.1
.3.1-045b529925f92141fbca5a09ccb76887 -package-id network-2.6.0.2-cd717cc95784d3
d2c843373d48659787 -package-id network-uri-2.6.0.1-474d71b66fbfc5e5890f880a23bc7
62f -package-id pretty-1.1.1.1-c695907dd1419865c9783baf249b36b0 -package-id proc
ess-1.2.0.0-8428b2db1fb32008b84b305e3dcf61f8 -package-id random-1.0.1.1-1c39aaa7
8f370b133a79ccf1ef25922b -package-id stm-2.4.2-6e8cfbcce8457ecf64e4555b5e253ae6
-package-id time-1.4.2-10261674b91c0791587926806ccad1bb -package-id zlib-0.5.4.1
-28702d80c2a2842f8db883ae46443522 -XHaskell98 .\Main.hs dist\build\cabal\cabal-t
mp\cbits/getnumcores.o -o dist\build\cabal\cabal.exe -Wall -fwarn-tabs -threaded
Linking dist\build\cabal\cabal.exe ...
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x26a6): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x2fae): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x300b): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x3156): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x393e): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x399b): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x3ade): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4336): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4393): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x44d6): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4c8e): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4ceb): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4e36): undefined reference to `shutdow
nWinSock'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Alberto\AppData\R
oaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/libHSHTTP-4000.2.19.a(TCP.o
): bad reloc address 0x0 in section `.data'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid
operation
collect2: ld returned 1 exit status
Failed to install cabal-install-1.20.0.4
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.4 failed during the building phase. The exception was:
ExitFailure 1
cabal install cabal-install -v --constraint="network==2.6.0.2"
[17 of 76] Compiling Distribution.Client.Types ( Distribution\Client\Types.hs, d
ist\build\cabal\cabal-tmp\Distribution\Client\Types.o )
[18 of 76] Compiling Distribution.Client.Dependency.Modular.Flag ( Distribution\
Client\Dependency\Modular\Flag.hs, dist\build\cabal\cabal-tmp\Distribution\Clien
t\Dependency\Modular\Flag.o )
[19 of 76] Compiling Distribution.Client.Dependency.Modular.Dependency ( Distrib
ution\Client\Dependency\Modular\Dependency.hs, dist\build\cabal\cabal-tmp\Distri
bution\Client\Dependency\Modular\Dependency.o )
[20 of 76] Compiling Distribution.Client.Dependency.Modular.Tree ( Distribution\
Client\Dependency\Modular\Tree.hs, dist\build\cabal\cabal-tmp\Distribution\Clien
t\Dependency\Modular\Tree.o )
[21 of 76] Compiling Distribution.Client.Dependency.Modular.Index ( Distribution
\Client\Dependency\Modular\Index.hs, dist\build\cabal\cabal-tmp\Distribution\Cli
ent\Dependency\Modular\Index.o )
[22 of 76] Compiling Distribution.Client.Dependency.Modular.Builder ( Distributi
on\Client\Dependency\Modular\Builder.hs, dist\build\cabal\cabal-tmp\Distribution
\Client\Dependency\Modular\Builder.o )
[23 of 76] Compiling Distribution.Client.Dependency.Modular.Message ( Distributi
on\Client\Dependency\Modular\Message.hs, dist\build\cabal\cabal-tmp\Distribution
\Client\Dependency\Modular\Message.o )
[24 of 76] Compiling Distribution.Client.Dependency.Modular.Configured ( Distrib
ution\Client\Dependency\Modular\Configured.hs, dist\build\cabal\cabal-tmp\Distri
bution\Client\Dependency\Modular\Configured.o )
[25 of 76] Compiling Distribution.Client.Dependency.Modular.Assignment ( Distrib
ution\Client\Dependency\Modular\Assignment.hs, dist\build\cabal\cabal-tmp\Distri
bution\Client\Dependency\Modular\Assignment.o )
[26 of 76] Compiling Distribution.Client.Dependency.Modular.Validate ( Distribut
ion\Client\Dependency\Modular\Validate.hs, dist\build\cabal\cabal-tmp\Distributi
on\Client\Dependency\Modular\Validate.o )
[27 of 76] Compiling Distribution.Client.Dependency.TopDown.Types ( Distribution
\Client\Dependency\TopDown\Types.hs, dist\build\cabal\cabal-tmp\Distribution\Cli
ent\Dependency\TopDown\Types.o )
[28 of 76] Compiling Distribution.Client.Dependency.Modular.IndexConversion ( Di
stribution\Client\Dependency\Modular\IndexConversion.hs, dist\build\cabal\cabal-
tmp\Distribution\Client\Dependency\Modular\IndexConversion.o )
[29 of 76] Compiling Distribution.Client.Init.Licenses ( Distribution\Client\Ini
t\Licenses.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Init\Licenses.o )
[30 of 76] Compiling Distribution.Client.Init.Types ( Distribution\Client\Init\T
ypes.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Init\Types.o )
[31 of 76] Compiling Distribution.Client.Compat.Time ( Distribution\Client\Compa
t\Time.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Compat\Time.o )
Distribution\Client\Compat\Time.hs:27:1: Warning:
the 'stdcall' calling convention is unsupported on this platform,
treating as ccall
When checking declaration:
foreign import stdcall safe "static windows.h GetFileAttributesExW" c_getF
ileAttributesEx
:: LPCTSTR -> Int32 -> LPVOID -> IO BOOL
Distribution\Client\Compat\Time.hs:90:62: Warning:
In the use of `bitSize' (imported from Data.Bits):
Deprecated: "Use 'bitSizeMaybe' or 'finiteBitSize' instead"
[32 of 76] Compiling Distribution.Client.Tar ( Distribution\Client\Tar.hs, dist\
build\cabal\cabal-tmp\Distribution\Client\Tar.o )
[33 of 76] Compiling Paths_cabal_install ( dist\build\autogen\Paths_cabal_instal
l.hs, dist\build\cabal\cabal-tmp\Paths_cabal_install.o )
[34 of 76] Compiling Distribution.Client.HttpUtils ( Distribution\Client\HttpUti
ls.hs, dist\build\cabal\cabal-tmp\Distribution\Client\HttpUtils.o )
[35 of 76] Compiling Distribution.Client.FetchUtils ( Distribution\Client\FetchU
tils.hs, dist\build\cabal\cabal-tmp\Distribution\Client\FetchUtils.o )
[36 of 76] Compiling Distribution.Client.Utils ( Distribution\Client\Utils.hs, d
ist\build\cabal\cabal-tmp\Distribution\Client\Utils.o )
[37 of 76] Compiling Distribution.Client.Init.Heuristics ( Distribution\Client\I
nit\Heuristics.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Init\Heuristic
s.o )
[38 of 76] Compiling Distribution.Client.IndexUtils ( Distribution\Client\IndexU
tils.hs, dist\build\cabal\cabal-tmp\Distribution\Client\IndexUtils.o )
[39 of 76] Compiling Distribution.Client.Sandbox.Index ( Distribution\Client\San
dbox\Index.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Sandbox\Index.o )
[40 of 76] Compiling Distribution.Client.InstallPlan ( Distribution\Client\Insta
llPlan.hs, dist\build\cabal\cabal-tmp\Distribution\Client\InstallPlan.o )
[41 of 76] Compiling Distribution.Client.Dependency.Types ( Distribution\Client\
Dependency\Types.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependency\T
ypes.o )
[42 of 76] Compiling Distribution.Client.Dependency.Modular.Log ( Distribution\C
lient\Dependency\Modular\Log.hs, dist\build\cabal\cabal-tmp\Distribution\Client\
Dependency\Modular\Log.o )
[43 of 76] Compiling Distribution.Client.Dependency.Modular.Explore ( Distributi
on\Client\Dependency\Modular\Explore.hs, dist\build\cabal\cabal-tmp\Distribution
\Client\Dependency\Modular\Explore.o )
[44 of 76] Compiling Distribution.Client.Dependency.Modular.Preference ( Distrib
ution\Client\Dependency\Modular\Preference.hs, dist\build\cabal\cabal-tmp\Distri
bution\Client\Dependency\Modular\Preference.o )
[45 of 76] Compiling Distribution.Client.Dependency.Modular.Solver ( Distributio
n\Client\Dependency\Modular\Solver.hs, dist\build\cabal\cabal-tmp\Distribution\C
lient\Dependency\Modular\Solver.o )
[46 of 76] Compiling Distribution.Client.Dependency.Modular.ConfiguredConversion
( Distribution\Client\Dependency\Modular\ConfiguredConversion.hs, dist\build\ca
bal\cabal-tmp\Distribution\Client\Dependency\Modular\ConfiguredConversion.o )
[47 of 76] Compiling Distribution.Client.Dependency.Modular ( Distribution\Clien
t\Dependency\Modular.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependen
cy\Modular.o )
[48 of 76] Compiling Distribution.Client.BuildReports.Anonymous ( Distribution\C
lient\BuildReports\Anonymous.hs, dist\build\cabal\cabal-tmp\Distribution\Client\
BuildReports\Anonymous.o )
[49 of 76] Compiling Distribution.Client.BuildReports.Storage ( Distribution\Cli
ent\BuildReports\Storage.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Buil
dReports\Storage.o )
[50 of 76] Compiling Distribution.Client.BuildReports.Upload ( Distribution\Clie
nt\BuildReports\Upload.hs, dist\build\cabal\cabal-tmp\Distribution\Client\BuildR
eports\Upload.o )
[51 of 76] Compiling Distribution.Client.Dependency.TopDown.Constraints ( Distri
bution\Client\Dependency\TopDown\Constraints.hs, dist\build\cabal\cabal-tmp\Dist
ribution\Client\Dependency\TopDown\Constraints.o )
[52 of 76] Compiling Distribution.Client.Dependency.TopDown ( Distribution\Clien
t\Dependency\TopDown.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependen
cy\TopDown.o )
[53 of 76] Compiling Distribution.Client.Win32SelfUpgrade ( Distribution\Client\
Win32SelfUpgrade.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Win32SelfUpg
rade.o )
Distribution\Client\Win32SelfUpgrade.hs:48:1: Warning:
The qualified import of `System.Win32.DLL' is redundant
except perhaps to import instances from `System.Win32.DLL'
To import instances alone, use: import System.Win32.DLL()
Distribution\Client\Win32SelfUpgrade.hs:164:1: Warning:
the 'stdcall' calling convention is unsupported on this platform,
treating as ccall
When checking declaration:
foreign import stdcall unsafe "static windows.h GetCurrentProcessId" getCu
rrentProcessId
:: IO DWORD
Distribution\Client\Win32SelfUpgrade.hs:167:1: Warning:
the 'stdcall' calling convention is unsupported on this platform,
treating as ccall
When checking declaration:
foreign import stdcall unsafe "static windows.h WaitForSingleObject" waitF
orSingleObject_
:: HANDLE -> DWORD -> IO DWORD
Distribution\Client\Win32SelfUpgrade.hs:178:1: Warning:
the 'stdcall' calling convention is unsupported on this platform,
treating as ccall
When checking declaration:
foreign import stdcall unsafe "static windows.h CreateEventW" createEvent_
:: Ptr () -> BOOL -> BOOL -> LPCTSTR -> IO HANDLE
Distribution\Client\Win32SelfUpgrade.hs:187:1: Warning:
the 'stdcall' calling convention is unsupported on this platform,
treating as ccall
When checking declaration:
foreign import stdcall unsafe "static windows.h OpenEventW" openEvent_
:: DWORD -> BOOL -> LPCTSTR -> IO HANDLE
Distribution\Client\Win32SelfUpgrade.hs:199:1: Warning:
the 'stdcall' calling convention is unsupported on this platform,
treating as ccall
When checking declaration:
foreign import stdcall unsafe "static windows.h SetEvent" setEvent_
:: HANDLE -> IO BOOL
[54 of 76] Compiling Distribution.Client.Init ( Distribution\Client\Init.hs, dis
t\build\cabal\cabal-tmp\Distribution\Client\Init.o )
[55 of 76] Compiling Distribution.Client.Sandbox.Types ( Distribution\Client\San
dbox\Types.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Sandbox\Types.o )
[56 of 76] Compiling Distribution.Client.Run ( Distribution\Client\Run.hs, dist\
build\cabal\cabal-tmp\Distribution\Client\Run.o )
[57 of 76] Compiling Distribution.Client.Check ( Distribution\Client\Check.hs, d
ist\build\cabal\cabal-tmp\Distribution\Client\Check.o )
[58 of 76] Compiling Distribution.Client.Update ( Distribution\Client\Update.hs,
dist\build\cabal\cabal-tmp\Distribution\Client\Update.o )
[59 of 76] Compiling Distribution.Client.Targets ( Distribution\Client\Targets.h
s, dist\build\cabal\cabal-tmp\Distribution\Client\Targets.o )
[60 of 76] Compiling Distribution.Client.Dependency ( Distribution\Client\Depend
ency.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependency.o )
[61 of 76] Compiling Distribution.Client.Setup ( Distribution\Client\Setup.hs, d
ist\build\cabal\cabal-tmp\Distribution\Client\Setup.o )
[62 of 76] Compiling Distribution.Client.Config ( Distribution\Client\Config.hs,
dist\build\cabal\cabal-tmp\Distribution\Client\Config.o )
[63 of 76] Compiling Distribution.Client.SetupWrapper ( Distribution\Client\Setu
pWrapper.hs, dist\build\cabal\cabal-tmp\Distribution\Client\SetupWrapper.o )
[64 of 76] Compiling Distribution.Client.Sandbox.Timestamp ( Distribution\Client
\Sandbox\Timestamp.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Sandbox\Ti
mestamp.o )
[65 of 76] Compiling Distribution.Client.Upload ( Distribution\Client\Upload.hs,
dist\build\cabal\cabal-tmp\Distribution\Client\Upload.o )
[66 of 76] Compiling Distribution.Client.List ( Distribution\Client\List.hs, dis
t\build\cabal\cabal-tmp\Distribution\Client\List.o )
[67 of 76] Compiling Distribution.Client.Configure ( Distribution\Client\Configu
re.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Configure.o )
[68 of 76] Compiling Distribution.Client.Fetch ( Distribution\Client\Fetch.hs, d
ist\build\cabal\cabal-tmp\Distribution\Client\Fetch.o )
[69 of 76] Compiling Distribution.Client.SrcDist ( Distribution\Client\SrcDist.h
s, dist\build\cabal\cabal-tmp\Distribution\Client\SrcDist.o )
[70 of 76] Compiling Distribution.Client.Get ( Distribution\Client\Get.hs, dist\
build\cabal\cabal-tmp\Distribution\Client\Get.o )
[71 of 76] Compiling Distribution.Client.Sandbox.PackageEnvironment ( Distributi
on\Client\Sandbox\PackageEnvironment.hs, dist\build\cabal\cabal-tmp\Distribution
\Client\Sandbox\PackageEnvironment.o )
[72 of 76] Compiling Distribution.Client.Freeze ( Distribution\Client\Freeze.hs,
dist\build\cabal\cabal-tmp\Distribution\Client\Freeze.o )
[73 of 76] Compiling Distribution.Client.InstallSymlink ( Distribution\Client\In
stallSymlink.hs, dist\build\cabal\cabal-tmp\Distribution\Client\InstallSymlink.o
)
[74 of 76] Compiling Distribution.Client.Install ( Distribution\Client\Install.h
s, dist\build\cabal\cabal-tmp\Distribution\Client\Install.o )
[75 of 76] Compiling Distribution.Client.Sandbox ( Distribution\Client\Sandbox.h
s, dist\build\cabal\cabal-tmp\Distribution\Client\Sandbox.o )
[76 of 76] Compiling Main ( Main.hs, dist\build\cabal\cabal-tmp\Main
.o )
Building C Sources...
creating dist\build\cabal\cabal-tmp
C:\Program Files\Haskell Platform\2014.2.0.0\bin\ghc.exe -c -static -odir dist\b
uild\cabal\cabal-tmp -Idist\build\autogen -Idist\build\cabal\cabal-tmp -optc-O2
-package-db dist\package.conf.inplace -package-id Cabal-1.20.0.2-2d0d4b50a80873b
d77d7619acdc39282 -package-id HTTP-4000.2.19-a3b06338bfc05de6b2dff745ab78e8e2 -p
ackage-id Win32-2.3.0.2-698249828064ce7d3e731406aa0b6536 -package-id array-0.5.0
.0-a620a6e52b09b01c2ee52fdc2f35ba14 -package-id base-4.7.0.1-7c4827d45272c622048
6aa798a981cbc -package-id bytestring-0.10.4.0-0168d7fce99b3d6589c7684c734053d4 -
package-id containers-0.5.5.1-08015588ba3fe884f62b392b72b7a17f -package-id direc
tory-1.2.1.0-8cccd8e1806d43153b63c8c02500965e -package-id filepath-1.3.0.2-a4d1d
9ee29199e7f421cb1e2eeca7b3c -package-id mtl-2.1.3.1-045b529925f92141fbca5a09ccb7
6887 -package-id network-2.6.0.2-cd717cc95784d3d2c843373d48659787 -package-id ne
twork-uri-2.6.0.1-474d71b66fbfc5e5890f880a23bc762f -package-id pretty-1.1.1.1-c6
95907dd1419865c9783baf249b36b0 -package-id process-1.2.0.0-8428b2db1fb32008b84b3
05e3dcf61f8 -package-id random-1.0.1.1-1c39aaa78f370b133a79ccf1ef25922b -package
-id stm-2.4.2-6e8cfbcce8457ecf64e4555b5e253ae6 -package-id time-1.4.2-10261674b9
1c0791587926806ccad1bb -package-id zlib-0.5.4.1-28702d80c2a2842f8db883ae46443522
cbits/getnumcores.c
Linking...
C:\Program Files\Haskell Platform\2014.2.0.0\bin\ghc.exe --make -fbuilding-cabal
-package -O -static -outputdir dist\build\cabal\cabal-tmp -odir dist\build\cabal
\cabal-tmp -hidir dist\build\cabal\cabal-tmp -stubdir dist\build\cabal\cabal-tmp
-i -idist\build\cabal\cabal-tmp -i. -idist\build\autogen -Idist\build\autogen -
Idist\build\cabal\cabal-tmp -optP-DWIN32 -optP-include -optPdist\build\autogen\c
abal_macros.h -hide-all-packages -package-db dist\package.conf.inplace -package-
id Cabal-1.20.0.2-2d0d4b50a80873bd77d7619acdc39282 -package-id HTTP-4000.2.19-a3
b06338bfc05de6b2dff745ab78e8e2 -package-id Win32-2.3.0.2-698249828064ce7d3e73140
6aa0b6536 -package-id array-0.5.0.0-a620a6e52b09b01c2ee52fdc2f35ba14 -package-id
base-4.7.0.1-7c4827d45272c6220486aa798a981cbc -package-id bytestring-0.10.4.0-0
168d7fce99b3d6589c7684c734053d4 -package-id containers-0.5.5.1-08015588ba3fe884f
62b392b72b7a17f -package-id directory-1.2.1.0-8cccd8e1806d43153b63c8c02500965e -
package-id filepath-1.3.0.2-a4d1d9ee29199e7f421cb1e2eeca7b3c -package-id mtl-2.1
.3.1-045b529925f92141fbca5a09ccb76887 -package-id network-2.6.0.2-cd717cc95784d3
d2c843373d48659787 -package-id network-uri-2.6.0.1-474d71b66fbfc5e5890f880a23bc7
62f -package-id pretty-1.1.1.1-c695907dd1419865c9783baf249b36b0 -package-id proc
ess-1.2.0.0-8428b2db1fb32008b84b305e3dcf61f8 -package-id random-1.0.1.1-1c39aaa7
8f370b133a79ccf1ef25922b -package-id stm-2.4.2-6e8cfbcce8457ecf64e4555b5e253ae6
-package-id time-1.4.2-10261674b91c0791587926806ccad1bb -package-id zlib-0.5.4.1
-28702d80c2a2842f8db883ae46443522 -XHaskell98 .\Main.hs dist\build\cabal\cabal-t
mp\cbits/getnumcores.o -o dist\build\cabal\cabal.exe -Wall -fwarn-tabs -threaded
Linking dist\build\cabal\cabal.exe ...
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x26a6): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x2fae): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x300b): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x3156): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x393e): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x399b): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x3ade): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4336): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4393): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x44d6): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4c8e): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4ceb): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4e36): undefined reference to `shutdow
nWinSock'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Alberto\AppData\R
oaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/libHSHTTP-4000.2.19.a(TCP.o
): bad reloc address 0x0 in section `.data'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid
operation
collect2: ld returned 1 exit status
Failed to install cabal-install-1.20.0.4
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.4 failed during the building phase. The exception was:
ExitFailure 1

Can't install c2hs and language-c

I'm using cabal here to install package c2hs. However, it requires happy, so I installed happy with cabal install happy.
After, when trying to install c2hs and language-c I get package happy not found on both.
Here's the terminal log:
~> cabal install happy
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs, /tmp/happy-1.18.9-12936/happy-1.18.9/dist/setup/Main.o )
/tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs:6:52:
Warning: In the use of `buildVerbose'
(imported from Distribution.Simple.Setup):
Deprecated: "Use buildVerbosity instead"
/tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs:7:52:
Warning: In the use of `defaultUserHooks'
(imported from Distribution.Simple):
Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
compatibility in which case you must stick with defaultUserHooks"
/tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs:12:26:
Warning: In the use of `try'
(imported from System.IO.Error):
Deprecated: "Please use the new exceptions variant, Control.Exception.try"
Linking /tmp/happy-1.18.9-12936/happy-1.18.9/dist/setup/setup ...
Warning: defaultUserHooks in Setup script is deprecated.
Configuring happy-1.18.9...
Building happy-1.18.9...
Preprocessing executable 'happy' for happy-1.18.9...
[ 1 of 18] Compiling NameSet ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
[ 2 of 18] Compiling Target ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o )
[ 3 of 18] Compiling AbsSyn ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
[ 4 of 18] Compiling ParamRules ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )
[ 5 of 18] Compiling GenUtils ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
[ 6 of 18] Compiling ParseMonad ( src/ParseMonad.lhs, dist/build/happy/happy-tmp/ParseMonad.o )
[ 7 of 18] Compiling Lexer ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o )
[ 8 of 18] Compiling Parser ( dist/build/happy/happy-tmp/Parser.hs, dist/build/happy/happy-tmp/Parser.o )
[ 9 of 18] Compiling AttrGrammar ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o )
[10 of 18] Compiling AttrGrammarParser ( dist/build/happy/happy-tmp/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o )
[11 of 18] Compiling Grammar ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o )
[12 of 18] Compiling First ( src/First.lhs, dist/build/happy/happy-tmp/First.o )
[13 of 18] Compiling LALR ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o )
[14 of 18] Compiling Paths_happy ( dist/build/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
[15 of 18] Compiling ProduceCode ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o )
[16 of 18] Compiling ProduceGLRCode ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o )
[17 of 18] Compiling Info ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o )
[18 of 18] Compiling Main ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o )
Linking dist/build/happy/happy ...
Installing executable(s) in /home/david/.cabal/bin
~> cabal install c2hs
Resolving dependencies...
Configuring language-c-0.3.2.1...
cabal: The program happy is required but it could not be found.
cabal: Error: some packages failed to install:
c2hs-0.16.3 depends on language-c-0.3.2.1 which failed to install.
language-c-0.3.2.1 failed during the configure step. The exception was:
ExitFailure 1
exit 1
~> cabal install language-c
Resolving dependencies...
Configuring language-c-0.4.2...
cabal: The program happy is required but it could not be found.
cabal: Error: some packages failed to install:
language-c-0.4.2 failed during the configure step. The exception was:
ExitFailure 1
exit 1
~>
Any ideas? Thank you.
I had to add ~/.cabal/bin to my path, and then it worked.

Resources