LancePutnam / Gamma

Generic (Sound) Synthesis Library
Other
458 stars 54 forks source link

Linker errors on macOS ARM64; Update lib_osx/libportaudio.a #62

Open kybr opened 9 months ago

kybr commented 9 months ago

OS: macOS Ventura 13.6 ARCH: Apple M1 (ARM64)

The error:

git clone https://github.com/LancePutnam/Gamma
cd Gamma
make
...
./run.sh examples/synths/Vib.cpp
ld: warning: ignoring file '/XXX/Gamma/external/lib_osx/libportaudio.a': fat file missing arch 'arm64', file has 'x86_64,unknown,i386,ppc'
ld: Undefined symbols:
  _Pa_CloseStream, referenced from:
      gam::AudioIO::~AudioIO() in libGamma.a[14](AudioIO.o)
      gam::AudioIO::close() in libGamma.a[14](AudioIO.o)
      gam::AudioIO::reopen() in libGamma.a[14](AudioIO.o)
      gam::AudioIO::reopen() in libGamma.a[14](AudioIO.o)
...

The remedy:

brew install portaudio
cp /opt/homebrew/lib/libportaudio.a external/lib_osx/libportaudio.a
./run.sh examples/synths/Vib.cpp
Press 'enter' to quit...

I don't love having a compiled library in the repository, but given that it is there, I think it needs updating.

LancePutnam commented 9 months ago

Yeah, I've been meaning to remove the binaries from the repo (the entire externals/ dir). It can be more convenient getting things up and running, but I just don't want to maintain it anymore. As an alternative, I could create an install script for dependencies, but that doesn't work for VS users. Otherwise I leave it entirely up to the user to install dependencies. Any thoughts welcome.