GLBasic forum

Main forum => GLBasic - en => Topic started by: Poetronic on 2012-Nov-01

Title: Compiling for Mac OS X 10.6.8
Post by: Poetronic on 2012-Nov-01
Hi all,

I just compiled a program that runs fine on Win for Mac OS X 10.6.8, but when I try to run it its only a black screen for a second and then the program closes. How can I get the program working? I have already tried to CHMOD the MacOSX executable, but it is still the same error. Help!
Title: Re: Compiling for Mac OS X 10.6.8
Post by: MrTAToad on 2012-Nov-02
Are you using the release version or trying the beta ?  If it's the former, then see what message you get when the executable is run in Terminal.
Title: Re: Compiling for Mac OS X 10.6.8
Post by: Poetronic on 2012-Nov-02
Terminal says that the fmod.dll module is not found and that an fopen request for the hiscore.ini failed. Doesn't the compiler automatically include those files in the app?

Code (glbasic) Select
DECLARE module not found: fmod.dll
request: fopen("hiscore.ini"), "rb") failed
Title: Re: Compiling for Mac OS X 10.6.8
Post by: Poetronic on 2012-Nov-02
I manually copied the necessary files to the Resources folder and now it is working but without sound... Is there a special way to include fmod.dll in OSX?

OK, correction: the fmod.dll is still not found although I put it in the correct folder together with the hiscore.ini (Resources). I also tried the folder where the Terminal says he's looking for it but it's still not found.

(PS - Maybe it's a compatibility issue between fmod.dll and OSX? I hope not, because the error message is about not finding the file.)
Title: Re: Compiling for Mac OS X 10.6.8
Post by: fuzzy70 on 2012-Nov-02
DLL files are Windows only so that could be the cause of your problem. Sadly I'm not 100% sure of the Mac equivalent :-[

Lee

Sent from my GT-I5700 using Tapatalk 2

Title: Re: Compiling for Mac OS X 10.6.8
Post by: MrTAToad on 2012-Nov-02
It sounds like the fmod library is being found, but perhaps not the correct version (or at least not a compatible version).  Are you using loading and using FMOD  yourself, or is it part of GLBasic's requirements ?
Title: Re: Compiling for Mac OS X 10.6.8
Post by: Poetronic on 2012-Nov-02
I'm loading and using it myself. It's a very old version I think but the only one I could find around here. Code is as follows and I also attached the fmod.dll. Any kind of help is highly appreciated!

Code (glbasic) Select
// --------------------------------- //
// Project: fmod player
// Start: Tuesday, May 09, 2006
// IDE Version: 3.118


INLINE
DECLARE_ALIAS(FMUSIC_LoadSong, "fmod.dll", "_FMUSIC_LoadSong@4", (const char* name), void*);
DECLARE_ALIAS(FMUSIC_PlaySong, "fmod.dll", "_FMUSIC_PlaySong@4", (void* pMod), char);
DECLARE_ALIAS(FMUSIC_FreeSong, "fmod.dll", "_FMUSIC_FreeSong@4", (void* pMod), char);
DECLARE_ALIAS(FSOUND_Init, "fmod.dll", "_FSOUND_Init@12", (int, int, unsigned int), char);
DECLARE_ALIAS(FSOUND_Close, "fmod.dll", "_FSOUND_Close@0", (void), void);
DECLARE_ALIAS(FMUSIC_IsFinished, "fmod.dll", "_FMUSIC_IsFinished@4", (void* pMod), char);
DECLARE_ALIAS(FMUSIC_SetMasterVolume, "fmod.dll", "_FMUSIC_SetMasterVolume@8", (void*, int), char);

void* g_pFMod = 0;

// need this for ESC-exits
struct FMOD_killer {~FMOD_killer() {if (g_pFMod) FMod_Stop();} } g_Fmod_killa;
ENDINLINE


GLOBAL fmod_init

FUNCTION FMod_Load: fname$
LOCAL good
IF fmod_init = FALSE
fmod_init=TRUE
ENDIF

FMod_Stop()
INLINE

if(FSOUND_Init) FSOUND_Init(44100,64,0);
if(FMUSIC_LoadSong)
g_pFMod = FMUSIC_LoadSong(fname_Str.c_str());
if(g_pFMod) good = true;

ENDINLINE
RETURN good
ENDFUNCTION


FUNCTION FMod_Play:
INLINE

if(FMUSIC_PlaySong && g_pFMod)
FMUSIC_PlaySong(g_pFMod);

ENDINLINE
ENDFUNCTION


FUNCTION FMod_Stop:
INLINE

if(FMUSIC_FreeSong && g_pFMod)
FMUSIC_FreeSong(g_pFMod);
g_pFMod = 0;
if(FSOUND_Close)
FSOUND_Close();
fmod_init=FALSE;
ENDINLINE
ENDFUNCTION



FUNCTION FMod_IsFinished:
INLINE
char ok=1;
if(FMUSIC_IsFinished && g_pFMod)
ok = FMUSIC_IsFinished(g_pFMod);
return ok ? TRUE : FALSE;
ENDINLINE

RETURN TRUE
ENDFUNCTION


FUNCTION FMod_SetMasterVolume: vol
INLINE
if(FMUSIC_SetMasterVolume && g_pFMod)
{
return FMUSIC_SetMasterVolume(g_pFMod, (int)(vol * 256.0)) ? TRUE:FALSE;
}
ENDINLINE
RETURN FALSE
ENDFUNCTION


[attachment deleted by admin]
Title: Re: Compiling for Mac OS X 10.6.8
Post by: fuzzy70 on 2012-Nov-03
http://stackoverflow.com/questions/4243191/dll-can-be-loaded-on-mac-os (http://stackoverflow.com/questions/4243191/dll-can-be-loaded-on-mac-os)

Like I said, you can't use DLL's on Mac OSX. Sorry

Lee
Title: Re: Compiling for Mac OS X 10.6.8
Post by: MrTAToad on 2012-Nov-03
As stated, that is for Windows only.  For the Mac version, you might want to look at this : http://www.glbasic.com/forum/index.php?topic=2678.msg19891#msg19891
Title: Re: Compiling for Mac OS X 10.6.8
Post by: spacefractal on 2012-Nov-03
You need to intefere with the mac version of fmod. The dll is win32 only.

Howover use the c++ interface for Mac version of it and here its would been to see code snippets of it.