Hi Guenther,

[x-posting to wxhaskell-devel, in case any of the other committers has a
clue...]

On Wed, 27 Jan 2010 17:04 +0100, "Günther Schmidt" <gue.schm...@web.de>
wrote:
>
> I managed to cabal-install wxWidgets on WinXP last night.
> 
> Now something strange happens when I test via ghci or runghc:
> 
>       could not find stdc++ dll
> 
> Now I did copy the wxmsu ... dll into the path ie. C:\windows\system32
> and when I run the compiled program it works.

This is a problem which has had me stumped for several weeks now. I'll
explain as best I can.

The root cause of the problem is related to the MinGW gcc installation
which is part of GHC, and which does C/C++ compilation and *all* linking
for both GHC and GHCi. The basic problem is this: for some reason,
almost all libraries in MinGW are dynamically linked *except* libstdc++,
which is *always* statically linked(*).

When compiling for GHC, this is no problem. the linker notices that
there is only a static version of libstdc++ available and uses it.
However, GHCi assumes (I think) that any libraries given to it on the
command line need to be loaded dynamically.

The incantation for which libraries to load when a package is loaded
comes from the package definition (in this case from the cabal
installation of wxcore). The problem is that I'm not sure of the best
way forward on this, and I've tried quite a few things.

What I really need is a coherent explanation of exactly how linking,
compilation and package loading is implemented by GHC and GHCi - I
understand the underlying gcc and gnu ld implementations well enough.

I'll eventually get around to a more complete description of the problem
and post to one of the GHC lists - but haven't done so as yet.

Regards
Jeremy
-- 
  Jeremy O'Donoghue
  jeremy.odonog...@gmail.com


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to