Recent

Author Topic: Can't find unit openal used by wavopenal  (Read 8286 times)

Clover

  • New Member
  • *
  • Posts: 46
Can't find unit openal used by wavopenal
« on: November 11, 2010, 09:34:01 pm »
I'm trying to use OpenAL in my program

I can successfully compile a test program I downloaded called wavopenal in Lazarus under Windows but when I try to compile it under OSX I get "Fatal: Can't find unit openal used by wavopenal"

I see that the file openal.pas is present, in /usr/local/share/fpcsrc/packages/openal/src

My OSX Lazarus 0.9.29 environment has fpc source directory set to /usr/local/share/fpcsrc and my other test programs without openal build fine. fpc is version 2.4.0 svn 26980

I'm obviously missing something here, can someone point me in the right direction? Thanks.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Can't find unit openal used by wavopenal
« Reply #1 on: November 11, 2010, 10:53:47 pm »
I don't believe openal is normally a compiled unit with 2.4.0. If you look at the source you can see why: it tries to link against a library, yet openal has been a standard Mac framework since Tiger (2004). The openal in FPC 2.5.1 now links correctly against the framework.

You could try 2.4.2rc1 and see if it's been fixed there too.

Thanks.

-Phil

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Can't find unit openal used by wavopenal
« Reply #2 on: November 11, 2010, 11:05:50 pm »
You could also copy your 2.4.0 openal.pas (and its 3 .inc files) to your app's folder and change the conditionals at the top to be like the 2.5.1 openal.pas:

{$IFDEF WINDOWS}
  {$DEFINE DYNLINK}
{$ENDIF}

{$IF Defined(DYNLINK)}
const
{$IF Defined(WINDOWS)}
  openallib = 'openal32.dll';
{$ELSEIF Defined(UNIX)}
  openallib = 'libopenal.so';
{$ELSE}
  {$MESSAGE ERROR 'DYNLINK not supported'}
{$IFEND}
{$ELSEIF Defined(Darwin)}
{$linkframework OpenAL}
{$ELSE}
  {$LINKLIB openal}
{$ENDIF}

Clover

  • New Member
  • *
  • Posts: 46
Re: Can't find unit openal used by wavopenal
« Reply #3 on: November 12, 2010, 08:01:39 am »
Many thanks Phil

Copying it to my app's folder and changing the header for Darwin worked a treat.

I'm curious why the IDE couldn't find the original source, though.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Can't find unit openal used by wavopenal
« Reply #4 on: November 16, 2010, 01:52:34 pm »
I'm curious why the IDE couldn't find the original source, though.

Lazarus never attempts to rebuild FPC packages and OpenAL is only built for darwin-x86 in FPC 2.5.1+

 

TinyPortal © 2005-2018