英文:
Building a go project with portaudio-go on OS X (+MacPorts)
问题
我试图在Mac OS X 10.8下运行portaudio-go
。我通过以下命令安装了portaudio:
sudo port install portaudio
这样portaudio.h
就位于/opt/local/include
。由于该文件夹不是默认的头文件位置,当我运行以下命令时:
go get code.google.com/p/portaudio-go/portaudio
我收到一个错误,说找不到portaudio.h
。是否有类似于-I /opt/local/include
的选项可以用于go?
英文:
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
答案1
得分: 1
我修改了portaudio.go
的前几行:
package portaudio
/*
#cgo CFLAGS: -I/opt/local/include
#cgo LDFLAGS: -L/opt/local/lib -lportaudio
现在一切都正常了,谢谢!
英文:
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!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论