[GHC] #1407: Add the ability to :set -l{foo} in .ghci files

GHC cvs-ghc at haskell.org
Sat Jan 12 20:06:11 CET 2013


#1407: Add the ability to :set -l{foo} in .ghci files
----------------------------------------+-----------------------------------
    Reporter:  guest                    |       Owner:  igloo           
        Type:  feature request          |      Status:  new             
    Priority:  normal                   |   Milestone:  _|_             
   Component:  GHCi                     |     Version:  6.6.1           
    Keywords:                           |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple         |     Failure:  None/Unknown    
  Difficulty:  Easy (less than 1 hour)  |    Testcase:                  
   Blockedby:                           |    Blocking:                  
     Related:                           |  
----------------------------------------+-----------------------------------

Comment(by igloo):

 This works:
 {{{
 $ ghci -lz
 GHCi, version 7.7.20130112: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading object (dynamic) /usr/lib/gcc/x86_64-linux-
 gnu/4.4.5/../../../../lib/libz.so ... done
 final link ... done
 Prelude> import Foreign.C
 Prelude Foreign.C> import Foreign.Ptr
 Prelude Foreign.C Foreign.Ptr> foreign import ccall "zlibVersion" z :: IO
 CString
 Prelude Foreign.C Foreign.Ptr> z >>= peekCString
 "1.2.3.4"
 Prelude Foreign.C Foreign.Ptr>
 }}}

 This doesn't:
 {{{
 $ ghci
 GHCi, version 7.7.20130112: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> :set -lz
 Prelude> import Foreign.C
 Prelude Foreign.C> import Foreign.Ptr
 Prelude Foreign.C Foreign.Ptr> foreign import ccall "zlibVersion" z :: IO
 CString

 ByteCodeLink: can't find label
 During interactive linking, GHCi couldn't find the following symbol:
   zlibVersion
 This may be due to you not asking GHCi to load extra object files,
 archives or DLLs needed by your current session.  Restart GHCi, specifying
 the missing library using the -L/path/to/object/dir and -lmissinglibname
 flags, or simply by naming the relevant files on the GHCi command line.
 Alternatively, this link failure might indicate a bug in GHCi.
 If you suspect the latter, please send a bug report to:
   glasgow-haskell-bugs at haskell.org
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1407#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list