Gary Klindt | 28 Nov 15:36 2012

OpenAL - compiling problem

Dear Haskell Cafe,

I tried installing the haskell openal library via
cabal install openal

I get the following error:

...
[ 7 of 30] Compiling Sound.OpenAL.ALC.QueryUtils ( 
Sound/OpenAL/ALC/QueryUtils.hs, dist/build/Sound/OpenAL/ALC/QueryUtils.o )

Sound/OpenAL/ALC/QueryUtils.hs:66:1:
     Unacceptable argument type in foreign declaration: ALCdevice
     When checking declaration:
       foreign import ccall unsafe "static alcGetString" alcGetString
         :: ALCdevice -> ALCenum -> IO (Ptr ALCchar)

Sound/OpenAL/ALC/QueryUtils.hs:102:1:
     Unacceptable argument type in foreign declaration: ALCdevice
     When checking declaration:
       foreign import ccall unsafe "static alcGetIntegerv" alcGetIntegerv
         :: ALCdevice -> ALCenum -> ALCsizei -> Ptr ALCint -> IO ()

Sound/OpenAL/ALC/QueryUtils.hs:120:1:
     Unacceptable argument type in foreign declaration: ALCdevice
     When checking declaration:
       foreign import ccall unsafe "static alcIsExtensionPresent" 
alcIsExtensionPresent_
         :: ALCdevice -> Ptr ALCchar -> IO ALCboolean
Failed to install OpenAL-1.4.0.1
(Continue reading)

Stephen Tetley | 28 Nov 19:01 2012
Picon

Re: OpenAL - compiling problem

Hi Gary

Which version of GHC are you using?

My suspicion is that ALCdevice might be a newtype falling foul of
recent changes to GHC...

v7.4.1: "GHC now requires, as per the standard, that if a newtype is
used in an FFI declaration, then the constructor for that type must be
in scope. For now you only get a warning if it is not, but in the
future this will be an error."
Gary Klindt | 28 Nov 21:07 2012

Re: OpenAL - compiling problem


On 11/28/2012 07:01 PM, Stephen Tetley wrote:
> Hi Gary
>
> Which version of GHC are you using?
>
> My suspicion is that ALCdevice might be a newtype falling foul of
> recent changes to GHC...
>
> v7.4.1: "GHC now requires, as per the standard, that if a newtype is
> used in an FFI declaration, then the constructor for that type must be
> in scope. For now you only get a warning if it is not, but in the
> future this will be an error."
>

Thank you for answering. Maybe you're right, I'm using v7.6.1.
So I can only wait for a patch or use an older version of ghc, right?
Stephen Tetley | 28 Nov 20:32 2012
Picon

Re: OpenAL - compiling problem

I think OpenAL is now unmaintained. You could try to find AndrewMiller
who updated the last version, otherwise you might have to patch it
yourself or ask a developer of a dependent package if they would
consider pushing another "unmaintained" release to Hackage.

Gmane