Build fails on Mac OS
iamarya2k24 opened this issue · comments
arya@Aryas-Mac-mini goplay2 % neofetch
'c. arya@Aryas-Mac-mini.local
,xNMM. -------------------------
.OMMMMo OS: macOS 11.6 20G165 arm64
OMMM0, Host: Macmini9,1
.;loddo:' loolloddol;. Kernel: 20.6.0
cKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 1 hour, 18 mins
.KMMMMMMMMMMMMMMMMMMMMMMMWd. Packages: 126 (brew)
XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: zsh 5.8
;MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 1920x1080
:MMMMMMMMMMMMMMMMMMMMMMMM: DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX. WM: Quartz Compositor
kMMMMMMMMMMMMMMMMMMMMMMMMWd. WM Theme: Blue (Dark)
.XMMMMMMMMMMMMMMMMMMMMMMMMMMk Terminal: iTerm2
.XMMMMMMMMMMMMMMMMMMMMMMMMK. Terminal Font: Monaco 12
kMMMMMMMMMMMMMMMMMMMMMMd CPU: Apple M1
;KMMMMMMMWXXWMMMMMMMk. GPU: Apple M1
.cooc,. .,coo:. Memory: 1381MiB / 8192MiB
arya@Aryas-Mac-mini goplay2 % brew install portaudio fdk-aac go
Updating Homebrew...
Warning: portaudio 19.7.0 is already installed and up-to-date.
To reinstall 19.7.0, run:
brew reinstall portaudio
Warning: fdk-aac 2.0.2 is already installed and up-to-date.
To reinstall 2.0.2, run:
brew reinstall fdk-aac
Warning: go 1.17.2 is already installed and up-to-date.
To reinstall 1.17.2, run:
brew reinstall go
arya@Aryas-Mac-mini goplay2 % go build
# goplay2/codec
codec/aac.go:32:10: fatal error: 'aacdecoder_lib.h' file not found
#include "aacdecoder_lib.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
Hi,
I just tried to build the project and have the same issue.
It's seems to be a path error for finding aacdecoder_lib.h
After exploring where the lib was stored with pkg-config --cflags fdk-aac
and the result : /usr/local/Cellar/fdk-aac/2.0.2/include
.
The header file is not inside the at the root of this path but inside the folder fdk-aac
You could change the file codec/aac.go
at line 32 from #include "aacdecoder_lib.h"
to #include "fdk-aac/aacdecoder_lib.h"
like ... two lines above for linux compile flag.
Moreother there is a pull request open for that : #30
But today like some people my iPhone is updated to iOS 15 and we are unable to pair iOS 15 with Airplay2 instance of goplay2 (#29) for the moment. Hope this could work one day :)
Build was successful with your changes, thanks! And yes it doesn't work with iOS 15 :(
Closed the issue for now, as the fix can be found via issue search and the problem is already being tracked.
@meta-n4vn33t I would suggest adding
#elif defined APPLE
#include "fdk-aac/aacdecoder_lib.h"
#else
to split the difference and avoid people having to search.
@meta-n4vn33t I would suggest adding #elif defined APPLE #include "fdk-aac/aacdecoder_lib.h" #else to split the difference and avoid people having to search.
ya