[Haskell-cafe] ffi linking problem

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue May 29 23:12:14 EDT 2007


On May 29, 2007, at 23:09 , jeff p wrote:

>    d:\ghc\ghc6.6\gcc-lib\ld.exe: cannot find -lmylib.lib
>    collect2: ld returned 1 exit status
>
> which is strange because the file mylib.lib is in the same directory
> as the haskell code.

Typically -l appends the necessary extension itself (.lib on  
Windows, .a or .so on Unix, .a or .dylib on OSX).  You may also need - 
L. (again, no space) to make it check the current directory.

It may be easier to see if ghc has an option to pass through the next  
argument straight to the linker, or even recognizes .lib files and  
passes them through unchanged (then you'd not need any option to  
include it, just the filename).  Unfortunately my knowledge of ghc on  
Windows is rather sketchy.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list