0
0

Well… I have a procedure like this one
[code:10vvyj1o]
procedure InitFMOD;
begin
if not FSOUND_Init(44100,32,0) then
begin
ShowMessage(’Somewhy, FMOD didn’t initialize’);
Exit;
end;
sndMus := FMUSIC_LoadSong(PChar(’Aurora.mod’));
if sndMus = nil then
begin
ShowMessage(’The stupid module wasn’t loaded’);
Exit;
end;
FMUSIC_PlaySong(sndMus);
end;
[/code:10vvyj1o]

Wow! Cool! That should work, but it won’t! I had to change this
[code:10vvyj1o]
{$IFDEF LINUX}
FMOD_DLL = ‘libfmod.so’;
{$ELSE}
{$IFDEF MSWINDOWS}
FMOD_DLL = ‘fmod.dll’;
{$ENDIF}
{$ENDIF}
[/code:10vvyj1o]
in line 510 of FMOD.PAS to this
[code]
FMOD_DLL = ‘fmod.dll’;
[code]
because if I just left it alone, it would keep giving me
[code]
[Error] fmod.pas(523): Identifier expected but ‘FUNCTION’ found
[/code]
to death (well, I dont use Linux, anyway). Ok, I changed it , and my program compiles fine, but, when I try to run it I get something like…
[quote:10vvyj1o]
It was not possible to locate the entry point of procedure FMUSIC_PlaySong in the fmod.dll dynamic link library
[/quote:10vvyj1o]. Then I comment that FMUSIC_PlaySong line , just to make sure it will never be compiled, and I get the same message above for FMUSIC_LoadSong and FSOUND_Init. The “simplest” (fmodapi373win\samples\simplest\Main.cpp) sample just works fine.

What did I just broke? Shouldn’t it be working, and I being happy?[/code]

  • You must to post comments
0
0

Sly,

I am not sure here but I think you can do this
{$IFDEF COMPILER6_UP}
{$IFDEF MSWINDOWS}
do the windows things
{$ENDIF}
{$IFDEF LINUX}
do the linux things
{$ENDIF}
{$ELSE}
do the compilers prior to 6 things
{$ENDIF}

Think I saw this COMPILER6_UP somewhere in
a JEDI or TurboPower component.

You might also have a look here:
http://cvs.freetype.org/cgi-bin/viewcvs … nc?rev=1.3

Good luck

  • You must to post comments
0
0

Ps : Oh noes! Don’t you love when you don’t close all those dumb tags?

  • You must to post comments
0
0

Ps.1 : I’m using Delphi5

  • You must to post comments
0
0

Ps.2 : Heh… sorry for the multiple posts :roll:

  • You must to post comments
0
0

Well, thank you all. I fixed it by removing those

{$IFDEF MSWINDOWS}{$ENDIF}

from the function declarations.

  • You must to post comments
0
0

Maybe it was with Delphi 6 that Borland introduced the MSWINDOWS define? They probably put it in the compiler when they introduced Kylix. I’m not sure really. Borland aren’t big on backwards compatibility and in the documentation for the newer versions of Delphi, they never say that “new feature X was introduced in Delphi version Y”, making it really very difficult to maintain backwards compatibility. They seem to assume that users will always use the latest and greatest. I know people still using Delphi 3 and even 16-bit Delphi 1.

If removing the defines fixed your problem, good. I’ll make note of it for the next version of the Delphi headers.

  • You must to post comments
0
0

just removing those $ifdefs would break it on linux
the correct way of fixing it is what i did in my delphi 3 version http://52.88.2.202/forum/viewtopic.php?t=3006

cut and paste
{$IFDEF WIN32}
{$DEFINE MSWINDOWS}
{$ENDIF}

out of the {$ifdef FPC} block

  • You must to post comments
0
0

[quote="plugwash":ha4vleqy]just removing those $ifdefs would break it on linux
the correct way of fixing it is what i did in my delphi 3 version http://52.88.2.202/forum/viewtopic.php?t=3006

cut and paste
{$IFDEF WIN32}
{$DEFINE MSWINDOWS}
{$ENDIF}

out of the {$ifdef FPC} block[/quote:ha4vleqy]

I don’t care. I will NEVER use Lisux again. :) There’s no correct way of fixing something that was never broken, so… you know :roll:

  • You must to post comments
0
0

that comment was more aimed at sly than at you asparagus

i would hate to see linux support broken when adding support for older delphi versions

  • You must to post comments
0
0

btw that guest was me

  • You must to post comments
0
0

The aim is to make the Delphi headers work for all platforms and all versions where possible. It’s just tricky getting everything declared properly when I do not have all the platforms and versions available to me.

  • You must to post comments
Showing 11 results
Your Answer

Please first to submit.