[Haskell-cafe] Name Decoration and Undefined References

SevenThunders mattcbro at earthlink.net
Sat Jun 30 21:09:14 EDT 2007




Bulat Ziganshin-2 wrote:
> 
> Hello SevenThunders,
> 
> Saturday, June 30, 2007, 7:45:57 AM, you wrote:
> 
>> My own code is half Haskell and half C.  My build process is rather
>> complex
> 
> i have the same. initially C code was compiled by gcc but finally i
> switched to ghc-only compilation. it's also important to use the same
> gcc for compiling both Haskell and C code (and using GHC as driver
> solves this problem, of course). i use make to control compilation of
> C code. you can download my program as
> http://www.haskell.org/bz/FreeArc-sources.tar.gz 
> 
> -- 
> Best regards,
>  Bulat                            mailto:Bulat.Ziganshin at gmail.com
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

Yes, I'm in the process of migrating to ghc wherever possible.  For my
little problem, I solved it by copying both the object code (.o files) and
the interface files (.hi files) to the source directory from the object file 
directory created by cabal specifically for building one of my libraries. 
That object code in turn was linked by gcc into another library (foo) with
some external C code.  Then to link against foo in Haskell I make sure it's
compiled with all the .hi files that had been  moved to the source
directory.  Thus you have to control the  files for a given build context
and keep them all together, prior to actually using any libraries or object
files built with that code.  You can't just bring in a different object file
during a previous or different link using ghc.  Unfortunately it's easy
enough to forget where your .hi files came from.


-- 
View this message in context: http://www.nabble.com/Name-Decoration-and-Undefined-References-tf4003458.html#a11378399
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list