JCHub

  • Home
  • Category
    • A/V
    • WebRTC
    • Beauty of Programming
    • Linux
    • Windows
    • Moments of Life
    • Campus Life
  • Reference
    • API Reference
    • Utilities
    • AV Test
    • Doc
  • Message Board
  • About
JCHub
Code as My Sword, Lost in Obsession
  1. Main page
  2. Beauty of Programming
  3. Main content

VS编译PortAudio

2015年4月26日 2744hotness 2likes 0comments

由于要做一个音频采集程序,可以将桌面声音采集到远程播放,直接用DirectSound或Wasapi比较麻烦,所以用PortAudio这个封装好的库。
1)首先到http://www.portaudio.com/download.html下载相应压缩包,解压到本地;

2)用VS打开build\msvc目录下的portaudio.sln文件,由于我用的是VS2012,所以打开后会有Upgrade提示,Upgrde出现的一些警告没什么影响;

3)打开 Project -> portaudio Properties然后选择"Configuration Properties",在"Configurations" 下拉框选择 "all configurations" . 在"Platforms"下拉框选择"All Platforms",接着在C/C++ -> Code Generation -> Runtime library 选择/MT
portaudio编译

4)由于我不需要ASIO,所以需要移除ASIO相关文件,如下图:
2015042602
接着在portaudio.def移除跟ASIO有关的入口
2015042603

5)Build PortAudio工程,此时会报“ LINK : fatal error LNK1104: cannot open file 'ksguid.lib'”的错误,由于该lib文件不再是Windows SDK的一部分,所以我们可以不需要它,在Configuration Properties->Linker->Input->Additional Dependencies中移除ksguid.lib,然后在Configuration Properties->C/C++ ->Preprocessor->Preprocesser Definitions中添加PA_WDMKS_NO_KSGUID_LIB

6)重新Build,就不会报错了,在相应目录下就会生成我们需要的文件。
2015042604

参考链接:1)官网:Windows下编译PortAudio
2)老外写的VS编译图解portAudio

This article is licensed with Creative Commons Attribution-NonCommercial-No Derivatives 4.0 International License
Tag: Nothing
Last updated:2018年12月23日

Jeff

管理员——代码为剑,如痴如醉

Tip the author Like
< Last article
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts
  • Nodejs C++ addon开发简介
  • Google ProtoBuf协议介绍
  • Intel Media SDK 内存优化(转)
  • 网络字节转换到本地字节的函数模板
  • 解决Ubuntu下vlc无法播放文件
Categories

COPYRIGHT © 2026 jianchihu.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang