[Haskell-cafe] Linking failing due to Control.Monad.State.Strict?

phil at beadling.co.uk phil at beadling.co.uk
Fri Aug 7 00:08:58 EDT 2009


Thanks for the reply.

> Otherwise, you'll need to go digging in
> your library for the .o files to link to by hand.

If I look with '-v' tho it seems to include Haskell libs in the  
underlying link - see below?  Plus it only complains about this  
library, I use many other standard libs too?  Looks like something  
stranger is going on?

Also I've tried using --include-pkg-deps (perhaps incorrectly) - it  
doesn't help.


Phil.


rm -f OptionCalculator
ghc -o OptionCalculator -O2 -Wall -v  ./FrameworkInterface.o ./Maths/ 
Prime.o ./Misc/Debug.o ./MonteCarlo/DataStructures.o ./MonteCarlo/ 
European.o ./MonteCarlo/Framework.o ./MonteCarlo/Interface.o ./ 
MonteCarlo/Lookback.o ./Normal/Acklam.o ./Normal/BoxMuller.o ./Normal/ 
Framework.o ./Normal/Interface.o ./OptionCalculator.o ./Random/ 
Framework.o ./Random/Halton.o ./Random/Interface.o ./Random/Ranq1.o
Glasgow Haskell Compiler, Version 6.10.4, for Haskell 98, stage 2  
booted by GHC version 6.10.3
Using package config file: /usr/local/lib/ghc-6.10.4/./package.conf
hiding package base-3.0.3.1 to avoid conflict with later version  
base-4.1.0.0
wired-in package ghc-prim mapped to ghc-prim-0.1.0.0
wired-in package integer mapped to integer-0.1.0.1
wired-in package base mapped to base-4.1.0.0
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0.1.0
wired-in package syb mapped to syb-0.1.0.1
wired-in package template-haskell mapped to template-haskell-2.3.0.1
wired-in package dph-seq mapped to dph-seq-0.3
wired-in package dph-par mapped to dph-par-0.3
Hsc static flags: -static
*** Linker:
gcc -v -o OptionCalculator FrameworkInterface.o Maths/Prime.o Misc/ 
Debug.o MonteCarlo/DataStructures.o MonteCarlo/European.o MonteCarlo/ 
Framework.o MonteCarlo/Interface.o MonteCarlo/Lookback.o Normal/ 
Acklam.o Normal/BoxMuller.o Normal/Framework.o Normal/Interface.o  
OptionCalculator.o Random/Framework.o Random/Halton.o Random/ 
Interface.o Random/Ranq1.o -L/usr/local/lib/ghc-6.10.4/ 
haskell98-1.0.1.0 -L/usr/local/lib/ghc-6.10.4/random-1.0.0.1 -L/usr/ 
local/lib/ghc-6.10.4/process-1.0.1.1 -L/usr/local/lib/ghc-6.10.4/ 
directory-1.0.0.3 -L/usr/local/lib/ghc-6.10.4/unix-2.3.2.0 -L/usr/ 
local/lib/ghc-6.10.4/old-time-1.0.0.2 -L/usr/local/lib/ghc-6.10.4/old- 
locale-1.0.0.1 -L/usr/local/lib/ghc-6.10.4/filepath-1.1.0.2 -L/usr/ 
local/lib/ghc-6.10.4/array-0.2.0.0 -L/usr/local/lib/ghc-6.10.4/ 
syb-0.1.0.1 -L/usr/local/lib/ghc-6.10.4/base-4.1.0.0 -L/usr/local/lib/ 
ghc-6.10.4/integer-0.1.0.1 -L/usr/local/lib/ghc-6.10.4/ghc- 
prim-0.1.0.0 -L/usr/local/lib/ghc-6.10.4 -lHShaskell98-1.0.1.0 - 
lHSrandom-1.0.0.1 -lHSprocess-1.0.1.1 -lHSdirectory-1.0.0.3 - 
lHSunix-2.3.2.0 -ldl -lHSold-time-1.0.0.2 -lHSold-locale-1.0.0.1 - 
lHSfilepath-1.1.0.2 -lHSarray-0.2.0.0 -lHSsyb-0.1.0.1 -lHSbase-4.1.0.0  
-lHSinteger-0.1.0.1 -lHSghc-prim-0.1.0.0 -lHSrts -lm -lffi -lgmp -ldl - 
u _ghczmprim_GHCziTypes_Izh_static_info -u  
_ghczmprim_GHCziTypes_Czh_static_info -u  
_ghczmprim_GHCziTypes_Fzh_static_info -u  
_ghczmprim_GHCziTypes_Dzh_static_info -u  
_base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u  
_base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u  
_base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info - 
u _base_GHCziWord_W8zh_static_info -u  
_base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info  
-u _base_GHCziWord_W64zh_static_info -u  
_base_GHCziStable_StablePtr_static_info -u  
_ghczmprim_GHCziTypes_Izh_con_info -u  
_ghczmprim_GHCziTypes_Czh_con_info -u  
_ghczmprim_GHCziTypes_Fzh_con_info -u  
_ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u  
_base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info  
-u _ghczmprim_GHCziBool_False_closure -u  
_ghczmprim_GHCziBool_True_closure -u  
_base_GHCziPack_unpackCString_closure -u  
_base_GHCziIOBase_stackOverflow_closure -u  
_base_GHCziIOBase_heapOverflow_closure -u  
_base_ControlziExceptionziBase_nonTermination_closure -u  
_base_GHCziIOBase_blockedOnDeadMVar_closure -u  
_base_GHCziIOBase_blockedIndefinitely_closure -u  
_base_ControlziExceptionziBase_nestedAtomically_closure -u  
_base_GHCziWeak_runFinalizzerBatch_closure -u  
_base_GHCziTopHandler_runIO_closure -u  
_base_GHCziTopHandler_runNonIO_closure -u  
_base_GHCziConc_runHandlers_closure -u  
_base_GHCziConc_ensureIOManagerIsRunning_closure -Wl,- 
search_paths_first -read_only_relocs warning
Using built-in specs.
Target: powerpc-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5490~1/src/configure --disable- 
checking -enable-werror --prefix=/usr --mandir=/share/man --enable- 
languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/ 
$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/ 
lib --build=i686-apple-darwin9 --program-prefix= --host=powerpc-apple- 
darwin9 --target=powerpc-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5490)
  /usr/libexec/gcc/powerpc-apple-darwin9/4.0.1/collect2 -dynamic -arch  
ppc -macosx_version_min 10.5.7 -read_only_relocs warning - 
weak_reference_mismatches non-weak -u  
_ghczmprim_GHCziTypes_Izh_static_info -u  
_ghczmprim_GHCziTypes_Czh_static_info -u  
_ghczmprim_GHCziTypes_Fzh_static_info -u  
_ghczmprim_GHCziTypes_Dzh_static_info -u  
_base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u  
_base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u  
_base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info - 
u _base_GHCziWord_W8zh_static_info -u  
_base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info  
-u _base_GHCziWord_W64zh_static_info -u  
_base_GHCziStable_StablePtr_static_info -u  
_ghczmprim_GHCziTypes_Izh_con_info -u  
_ghczmprim_GHCziTypes_Czh_con_info -u  
_ghczmprim_GHCziTypes_Fzh_con_info -u  
_ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u  
_base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info  
-u _ghczmprim_GHCziBool_False_closure -u  
_ghczmprim_GHCziBool_True_closure -u  
_base_GHCziPack_unpackCString_closure -u  
_base_GHCziIOBase_stackOverflow_closure -u  
_base_GHCziIOBase_heapOverflow_closure -u  
_base_ControlziExceptionziBase_nonTermination_closure -u  
_base_GHCziIOBase_blockedOnDeadMVar_closure -u  
_base_GHCziIOBase_blockedIndefinitely_closure -u  
_base_ControlziExceptionziBase_nestedAtomically_closure -u  
_base_GHCziWeak_runFinalizzerBatch_closure -u  
_base_GHCziTopHandler_runIO_closure -u  
_base_GHCziTopHandler_runNonIO_closure -u  
_base_GHCziConc_runHandlers_closure -u  
_base_GHCziConc_ensureIOManagerIsRunning_closure -o OptionCalculator - 
lcrt1.10.5.o -L/usr/local/lib/ghc-6.10.4/haskell98-1.0.1.0 -L/usr/ 
local/lib/ghc-6.10.4/random-1.0.0.1 -L/usr/local/lib/ghc-6.10.4/ 
process-1.0.1.1 -L/usr/local/lib/ghc-6.10.4/directory-1.0.0.3 -L/usr/ 
local/lib/ghc-6.10.4/unix-2.3.2.0 -L/usr/local/lib/ghc-6.10.4/old- 
time-1.0.0.2 -L/usr/local/lib/ghc-6.10.4/old-locale-1.0.0.1 -L/usr/ 
local/lib/ghc-6.10.4/filepath-1.1.0.2 -L/usr/local/lib/ghc-6.10.4/ 
array-0.2.0.0 -L/usr/local/lib/ghc-6.10.4/syb-0.1.0.1 -L/usr/local/lib/ 
ghc-6.10.4/base-4.1.0.0 -L/usr/local/lib/ghc-6.10.4/integer-0.1.0.1 -L/ 
usr/local/lib/ghc-6.10.4/ghc-prim-0.1.0.0 -L/usr/local/lib/ghc-6.10.4 - 
L/usr/lib/powerpc-apple-darwin9/4.0.1 -L/usr/lib/gcc/powerpc-apple- 
darwin9/4.0.1 -L/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 -L/usr/lib/ 
gcc/powerpc-apple-darwin9/4.0.1/../../../powerpc-apple-darwin9/4.0.1 - 
L/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/../../..  
FrameworkInterface.o Maths/Prime.o Misc/Debug.o MonteCarlo/ 
DataStructures.o MonteCarlo/European.o MonteCarlo/Framework.o  
MonteCarlo/Interface.o MonteCarlo/Lookback.o Normal/Acklam.o Normal/ 
BoxMuller.o Normal/Framework.o Normal/Interface.o OptionCalculator.o  
Random/Framework.o Random/Halton.o Random/Interface.o Random/Ranq1.o - 
lHShaskell98-1.0.1.0 -lHSrandom-1.0.0.1 -lHSprocess-1.0.1.1 - 
lHSdirectory-1.0.0.3 -lHSunix-2.3.2.0 -ldl -lHSold-time-1.0.0.2 - 
lHSold-locale-1.0.0.1 -lHSfilepath-1.1.0.2 -lHSarray-0.2.0.0 - 
lHSsyb-0.1.0.1 -lHSbase-4.1.0.0 -lHSinteger-0.1.0.1 -lHSghc- 
prim-0.1.0.0 -lHSrts -lm -lffi -lgmp -ldl -search_paths_first -lgcc_s. 
10.5 -lgcc -lSystemStubs -lSystem
Undefined symbols:
   "_mtlzm1zi1zi0zi2_ControlziMonadziStateziStrict_a29_info",  
referenced from:
       _r1hl_info in Acklam.o
       _rGL_info in BoxMuller.o
   "_mtlzm1zi1zi0zi2_ControlziMonadziStateziStrict_a29_closure",  
referenced from:
       _r1hl_srt in Acklam.o
       _rGL_srt in BoxMuller.o
   "___stginit_mtlzm1zi1zi0zi2_ControlziMonadziStateziStrict_",  
referenced from:
       ___stginit_FrameworkInterface_ in FrameworkInterface.o
       ___stginit_FrameworkInterface_ in FrameworkInterface.o
       ___stginit_MonteCarloziEuropean_ in European.o
       ___stginit_MonteCarloziEuropean_ in European.o
       ___stginit_MonteCarloziFramework_ in Framework.o
       ___stginit_MonteCarloziFramework_ in Framework.o
       ___stginit_MonteCarloziLookback_ in Lookback.o
       ___stginit_MonteCarloziLookback_ in Lookback.o
       ___stginit_NormalziAcklam_ in Acklam.o
       ___stginit_NormalziAcklam_ in Acklam.o
       ___stginit_NormalziBoxMuller_ in BoxMuller.o
       ___stginit_NormalziBoxMuller_ in BoxMuller.o
       ___stginit_NormalziFramework_ in Framework.o
       ___stginit_NormalziFramework_ in Framework.o
       ___stginit_RandomziFramework_ in Framework.o
       ___stginit_RandomziFramework_ in Framework.o
       ___stginit_RandomziHalton_ in Halton.o
       ___stginit_RandomziHalton_ in Halton.o
       ___stginit_RandomziRanq1_ in Ranq1.o
       ___stginit_RandomziRanq1_ in Ranq1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
make: *** [OptionCalculator] Error 1



Cheers,

Phil.

On 7 Aug 2009, at 02:46, Daniel Peebles wrote:

> Sorry, I missed that you'd tried that. Why would you not want to use
> --make? The issue is that when you import a module in your standard
> library, you need to link to it, and ghc --make takes care of figuring



More information about the Haskell-Cafe mailing list