[Haskell-cafe] Re: ghc error: requested module name differs from name found in interface file

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Tue Oct 21 08:35:08 EDT 2008


Larry Evans wrote:
> On 10/20/08 12:33, Larry Evans wrote:
>> With a file containing:
>>  > module Main where
>>  >
>>  > import Array
>>  > import Control.Functor.Fix
>> I get:
>>  > make
>>  > ghc -i/root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2 -c 
>> catamorphism.example.hs

Yes, using -i to give paths to installed packages does not work - you
really have to tell ghc about the corresponding package.conf file,
using -package-conf file. See also

  http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html#package-databases

>>  > catamorphism.example.hs:19:0:
>>  >     Bad interface file: 
>> /root/.cabal/lib/category-extras-0.53.5/ghc-6.8.2/Control/Functor/Fix.hi
>>  >         Something is amiss; requested module main:Control.Functor.Fix 
>> differs from name found in the interface file 
>> category-extras-0.53.5:Control.Functor.Fix
>>  > make: *** [all] Error 1

The problem is that all modules found by -i are expected to be in the
current package - which is 'main' by default. (Build tools like Cabal
specify a different package name for libraries; for example the
Control.Functor.Fix is in the 'category-extras-0.53.5' package here.)

> So, I've got to figure how to tell cabal install to install in right
> place :(

Have you tried 'cabal install --global'? To make it stick, put
'user-install: False' in root's .cabal/config file.

HTH,

Bertram


More information about the Haskell-Cafe mailing list