duanqujing3863
2013-05-21 16:38
浏览 87
已采纳

在OS X(+ MacPorts)上使用portaudio-go构建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

图片转代码服务由CSDN问答提供 功能建议

我尝试让 portaudio-go 在Mac OS X 10.8下运行。 我通过

  sudo端口安装了portaudio 
   
 
 

,所以现在是 portaudio.h 位于 / opt / local / include 中。 由于该文件夹不是头文件的默认位置,因此在运行时

 去获取code.google.com/p/portaudio-go/portaudio
    
 
 

我收到一条错误消息,提示找不到 portaudio.h 。 有什么等同于我可以使用的 -I / opt / local / include 吗?

/ edit:已回答

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dpt8910 2013-05-21 19:43
    已采纳

    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!

    点赞 打赏 评论

相关推荐 更多相似问题