jarikomppa / soloud

Free, easy, portable audio engine for games
http://soloud-audio.com
Other
1.69k stars 270 forks source link

Build fails on OSX #305

Closed MoritzKn closed 2 years ago

MoritzKn commented 3 years ago

Expected behavior:

Build works on OSX.

Actual behavior:

==== Building SoloudStatic (debug) ====
Creating debug/Debug/SoloudStatic
Creating debug/Debug/SoloudStatic/src/audiosource/ay
Creating debug/Debug/SoloudStatic/src/audiosource/monotone
Creating debug/Debug/SoloudStatic/src/audiosource/noise
Creating debug/Debug/SoloudStatic/src/audiosource/openmpt
Creating debug/Debug/SoloudStatic/src/audiosource/sfxr
Creating debug/Debug/SoloudStatic/src/audiosource/speech
Creating debug/Debug/SoloudStatic/src/audiosource/tedsid
Creating debug/Debug/SoloudStatic/src/audiosource/vic
Creating debug/Debug/SoloudStatic/src/audiosource/vizsn
Creating debug/Debug/SoloudStatic/src/audiosource/wav
Creating debug/Debug/SoloudStatic/src/backend/coreaudio
Creating debug/Debug/SoloudStatic/src/backend/null
Creating debug/Debug/SoloudStatic/src/core
Creating debug/Debug/SoloudStatic/src/filter
Creating ../../lib
chipplayer.cpp
../../src/audiosource/ay/chipplayer.cpp:4:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make[1]: *** [debug/Debug/SoloudStatic/src/audiosource/ay/chipplayer.o] Error 1
make: *** [SoloudStatic] Error 2

Steps to reproduce the problem:

On OSX:

$ cd build
$ genie gmake
Active options:
WITH_SDL        =   0
WITH_SDL2       =   0
WITH_PORTAUDIO  =   0
WITH_OPENAL     =   0
WITH_XAUDIO2    =   0
WITH_WINMM      =   0
WITH_WASAPI     =   0
WITH_ALSA       =   0
WITH_JACK       =   0
WITH_OSS        =   0
WITH_MINIAUDIO  =   0
WITH_NOSOUND    =   0
WITH_COREAUDIO  =   1
WITH_VITA_HOMEBREW =    0
WITH_TOOLS      =   0

Building configurations...
Running action 'gmake'...
Generating "gmake/Makefile"
Generating "gmake/simplest.make"
Generating "gmake/welcome.make"
Generating "gmake/null.make"
Generating "gmake/enumerate.make"
Generating "gmake/SoloudStatic.make"
Generating "gmake/c_test.make"
Generating "gmake/SoloudDynamic.make"
Done. Generated 8/8 projects.
$ cd gmake
$ make

SoLoud version, operating system, backend used, any other potentially useful information:

Current master: (4d72336a8855f3f421f95ec75cda9062da3fe7eb)

Green-Sky commented 3 years ago

There now have been 3 PRs for this issue (the first got closed??) @jarikomppa please do something...

apachano commented 3 years ago

Gonna add another bump for fixing this, the PR https://github.com/jarikomppa/soloud/pull/302 would solve the problem

dortamiguel commented 3 years ago

I have the same issue

jarikomppa commented 3 years ago

Apologies, I don't compile on apple platforms myself.

dortamiguel commented 3 years ago

@jarikomppa Thank you for merging the PR, now I get the following errors when trying to build for mac

/Users/miguel/src/prototype/bin/soloud/src/tools/lutgen/main.cpp:149:18: fatal error: use of undeclared identifier '_stricmp'; did you mean 'strcmp'?
        if (parc < 2 || _stricmp(pars[1], "go") != 0)
                        ^~~~~~~~
                        strcmp
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/string.h:77:6: note: 'strcmp' declared here
int      strcmp(const char *__s1, const char *__s2);
         ^
7 warnings and 1 error generated.
make[2]: *** [CMakeFiles/common.dir/bin/soloud/src/tools/lutgen/main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/Users/miguel/src/prototype/bin/soloud/src/backend/vita_homebrew/soloud_vita_homebrew.cpp:31:10: fatal error: 'psp2/audioout.h' file not found
#include <psp2/audioout.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
/Users/miguel/src/prototype/bin/soloud/src/tools/sanity/sanity.cpp:103:12: fatal error: member reference type 'struct timespec' is not a pointer; did you mean to use '.'?
        return (ts->tv_sec * 1000) + (ts->tv_nsec / 1000000)
                ~~^~
                  .
1 error generated.
make[2]: *** [CMakeFiles/common.dir/bin/soloud/src/tools/sanity/sanity.cpp.o] Error 1
make[2]: *** [CMakeFiles/common.dir/bin/soloud/src/backend/vita_homebrew/soloud_vita_homebrew.cpp.o] Error 1
make[1]: *** [CMakeFiles/common.dir/all] Error 2
make: *** [all] Error 2

Do you think there is an easy solution for this?

jarikomppa commented 3 years ago

First, I don't think you need to compile lutgen or sanity, and unless you're writing software for ps vita I don't think you need the vita_homebrew either..

But if you do want to compile those, I think the mac equivalent of _stricmp is strcasecmp.

dortamiguel commented 3 years ago

Ah perfect, I removed those and it works fine now. thanks!

MoritzKn commented 3 years ago

Sounds like this is fixed?