#1883: GHC can't find library using "short" name
----------------------------------+-----------------------------------------
 Reporter:  m4dc4p                |          Owner:         
     Type:  bug                   |         Status:  new    
 Priority:  normal                |      Milestone:         
Component:  Compiler              |        Version:  6.6.1  
 Severity:  normal                |     Resolution:         
 Keywords:  link library windows  |     Difficulty:  Unknown
 Testcase:                        |   Architecture:  x86    
       Os:  Windows               |  
----------------------------------+-----------------------------------------
Changes (by duncan):

  * difficulty:  => Unknown

Comment:

 I've dealt with this problem in Gtk2Hs before. The issue is that the .dll
 name can differ from the static library name or the import library name.

 For example gcc -lfoo will link with libfoo.a on windows (or foo.lib and
 probably some other variants too). The .a/.lib file knows exactly which
 dll this will correspond to at runtime. The gcc/ld linker bakes this
 information into the .exe so the windows dll will look for the right file.
 So the point is the name of the .dll need not match the name of the
 .a/.lib file.

 So that's all well and good for the case of making a .exe and using the
 native linker. GHCi has more difficulty since it does not actually know
 the name of the dll at all since it does not read the static import lib.
 So it just has to guess based on the name of the library. Most windows
 dlls have exactly the same name as the import lib, but some that have been
 ported from unix use a "lib" prefix on their dll name.

 The slightly hacky solution we implemented to make Gtk2Hs work nicely on
 windows was to add to ghc an extra field, "extra-ghci-libraries:" to the
 package registration file, so that ghci could use different names for the
 libraries than in the static case where we use the native linker.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1883#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to