Link errors when using the GHC API

Bas van Dijk basvandijk at home.nl
Mon Oct 16 11:42:27 EDT 2006


On Monday 16 October 2006 12:41, Duncan Coutts wrote:
> This is a problem with the way we have packaged it for Gentoo. We know
> the source of the problem and will fix it soon.

Great, thanks.

On Monday 16 October 2006 12:46, Clemens Fruhwirth wrote:
> The problem is Gentoo specific. Quick dirty fix: cp
> /usr/lib/ghc-6.6/HSCabal.o /usr/lib/Cabal-1.1.6/ghc-6.6/HSCabal-1.1.6.o

This seems to get rid of the problem in ghci:

$ ghci -package ghc
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package readline-1.0 ... linking ... done.
Loading package unix-1.0 ... linking ... done.
Loading package Cabal-1.1.6 ... linking ... done.
Loading package regex-base-0.71 ... linking ... done.
Loading package regex-posix-0.71 ... linking ... done.
Loading package regex-compat-0.71 ... linking ... done.
Loading package haskell98 ... linking ... done.
Loading package ghc-6.6 ... linking ... done.
Prelude>                        

But the problem remains when making for example testGHC.gs:

-------------------------------------------------------------------------------
module Main where

import qualified GHC
import DynFlags (defaultDynFlags)

main = GHC.defaultErrorHandler defaultDynFlags $ putStrLn "Hello World"
-------------------------------------------------------------------------------

$ ghc -package ghc --make testGHC.hs
[1 of 1] Compiling Main             ( testGHC.hs, testGHC.o )
Linking testGHC ...
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o): In function `r6iZ_info':
: undefined reference to 
`Cabalzm1zi1zi6_LanguageziHaskellziExtension_optional_info'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o): In function `s6r9_info':
: undefined reference to 
`Cabalzm1zi1zi6_LanguageziHaskellziExtension_zdwshowsPrec_info'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o): In function `s6sJ_info':
: undefined reference to `Cabalzm1zi1zi6_DistributionziCompiler_lvl31_info'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o): In function `s6sN_info':
: undefined reference to `Cabalzm1zi1zi6_DistributionziCompiler_zddEq_closure'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o): In function `s6ID_0_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziCompiler_polyzugo_info'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o): In function `s6IG_0_alt':
: undefined reference to 
`Cabalzm1zi1zi6_DistributionziCompiler_polyzugo1_info'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o):(.rodata+0x0): undefined reference 
to `Cabalzm1zi1zi6_LanguageziHaskellziExtension_optional_closure'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o):(.rodata+0x1cc): undefined reference 
to `Cabalzm1zi1zi6_LanguageziHaskellziExtension_zdwshowsPrec_closure'
/usr/lib/ghc-6.6/libHSghc.a(HeaderInfo.o):(.rodata+0x1dc): undefined reference 
to `Cabalzm1zi1zi6_DistributionziCompiler_lvl31_closure'
/usr/lib/ghc-6.6/libHSghc.a(PackageConfig.o): In function `s23t_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Packages.o): In function `s77S_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Packages.o): In function `s79E_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Packages.o): In function `s7i7_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Packages.o): In function `s7vI_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Packages.o): In function `s7yi_info':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_zeze_info'
/usr/lib/ghc-6.6/libHSghc.a(Packages.o): In function `s7GC_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Linker.o): In function `s8TZ_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Linker.o): In function `s8Vv_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
/usr/lib/ghc-6.6/libHSghc.a(Finder.o): In function `s7l2_1_alt':
: undefined reference to `Cabalzm1zi1zi6_DistributionziPackage_a_closure'
collect2: ld returned 1 exit status


More information about the Glasgow-haskell-users mailing list