[Haskell-cafe] How to fix linker errors when creating a package using cabal

Peter Verswyvelen bf3 at telenet.be
Sat Aug 25 08:53:57 EDT 2007


Indeed, adding the non-exposed modules to the other-modules fixed it.

Thanks Allan!

Cheers,
Peter

-----Original Message-----
From: Allan Clark [mailto:a.d.clark at ed.ac.uk] 
Sent: Saturday, August 25, 2007 2:28 PM
To: Peter Verswyvelen
Subject: Re: [Haskell-cafe] How to fix linker errors when creating a package
using cabal

Peter Verswyvelen wrote:
> I'm trying to make a package of Ben.Lippmeier's very nice ANUPlot graphics
> library (http://cs.anu.edu.au/people/Ben.Lippmeier)
>
> IMHO this would be a great contribution to the Haskell library, it's very
> clean code for newbies :)
>
> I created the following cabal file:
>
> name: Plot
> version: 1.1
> license: AllRightsReserved
> maintainer: Ben.Lippmeier at anu.edu.au
> exposed-modules: 
> 	Graphics.Plot.Display, 
> 	Graphics.Plot.Picture, 
> 	Graphics.Plot.Primitive, 
> 	Graphics.Plot.Render, 
> 	Graphics.Plot.Colors,
> 	Graphics.Plot.Util,
> 	Graphics.Plot.RenderState,
> 	Graphics.Plot.Animate,
> 	Graphics.Plot.View,
> 	Graphics.Plot.Wrapper,
> 	Graphics.Plot
> Build-Depends:  base, OpenGL, GLUT
> ghc-options: -fglasgow-exts
>
> and then tried 
> runhaskell Setup.hs configure
> runhaskell Setup.hs build
> runhaskell Setup.hs install
>
> which all seemed to work fine (see log below).
>
> However, when building an example that uses that package, I get a lot of
> linker errors (see log below)
>
> Is this because I configured the cabal files incorrectly, or do I have to
> adjust the module sources so they explicitly export the missing symbols?
>
> Thanks,
> Peter
> [ snip ]
>
Files\Haskell\Plot-1.1\ghc-6.6.1/libHSPlot-1.1.a(Wrapper.o)(.text+0x2f1):fak
> e: undefined reference to
> `Plotzm1zi1_GraphicsziPlotziCallback_Display_con_info'
>   
Hi, I'm not cabal expert, but basically I had a similar problem, and I 
fixed it by adding a missing module in the 'exposed-modules' part. 
Basically where is con_info defined, it's probably in a module which 
isn't exposed.
If so then either put it in the 'exposed-modules' section or if you do 
not wish to expose it then maybe you could try putting it in a 
'other-modules' section.

regards
allan




More information about the Haskell-Cafe mailing list