2

I try to get portaudio-go running under Mac OS X 10.8. I installed portaudio via

sudo port install portaudio

so that now portaudio.h is located in /opt/local/include. Since the folder is not a default location for header-files, when running

go get code.google.com/p/portaudio-go/portaudio

I get an error saying that the portaudio.h could not be found. Is there something equivalent to -I /opt/local/include I could use for go?

/edit: Answered

3
  • 1
    You'll probably need to download portaudio-go and change the CGOFLAGS in the cgo file.
    – cthom06
    May 21, 2013 at 16:47
  • 1
    As @cthom06 suggested you'll need to add something like // #cgo linux CFLAGS: -I/opt/local/include to the top of the portaudio.go file. You should have a local copy after the go get and then you can rebuild with go build and go install from the directory that portaudio.go was downloaded to. That directory depends on how you've set up your Go environment variables. May 21, 2013 at 17:07
  • @KevinD If you found a solution, you should write an answer so that you can accept it.
    – nemo
    May 21, 2013 at 18:25

1 Answer 1

1

I modified the first lines of portaudio.go:

package portaudio

/*
#cgo CFLAGS: -I/opt/local/include
#cgo LDFLAGS: -L/opt/local/lib -lportaudio

Now everything works fine, thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.