编译opensmile支持portaudio

1.将opensmile-2.3.0文件夹下的thirdparty中的portaudio解压

   或者从http://www.portaudio.com/下载最新的portaudio

  (如D:\Software\OpenSMILE\opensmile-2.3.0\thirdparty\portaudio\bindings)

2.将opensmile-2.3.0\ide\vs10下的portaudio.def和portaudio.vcxproj文件复制到

    opensmile-2.3.0\thirdparty\portaudio\build\msvc下

3.用VS2013打开opensmile-2.3.0\ide\vs10下的openSmile.sln

   选择ReleasePortaudio

   编译opensmile支持portaudio

由于Visual Studio的某些原因会在在某些配置中没法正确识别项目构建顺序,因此如果您只选择“编译方案(Build solution)”选项,则编译过程可能会失败。要解决这个问题,你必须手动编译项目。首先编译portaudio,然后是openSmileLib *,然后是openSmileLib,最后是SMILExtract,或者尝试多次编译整个解决方案,直到错误消息的数量已经收敛(编译失败,尝试手动编译项目)或已达到零(编译成功!)。

按照portaudio--openSmileLibClassif--openSmileLibLibsvm--openSmileLibPortaudio--openSmileLib--SMILExtract顺序依次编译

4.若出现error MSB8020错误 

error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".   

编译opensmile支持portaudio

portaudio--右键--properties 在Platform Toolset 中选择Visual Studio 2013(v120)

   编译opensmile支持portaudio

5.若报错error C1189  Portaudio: PA_NO_<APINAME> is no longer supported

error C1189: #error :  "Portaudio: PA_NO_<APINAME> is no longer supported, please remove definition and use PA_USE_<APINAME> instead"    d:\software\opensmile\opensmile-2.3.0\thirdparty\portaudio\src\common\pa_hostapi.h    71    1    portaudio

将pa_hostapi.h中的PA_NO_XXX中替换为PA_USE_XXX

编译opensmile支持portaudio

6.如果报错error C1083: Cannot open source file: '..\..\src\common\pa_skeleton.c': No such file or directory   

经过查找发现在opensmile-2.3.0\thirdparty\portaudio\src\common并没有pa_skeleton.c文件

通过搜索发现在opensmile-2.3.0\thirdparty\portaudio\src\hostapi\skeleton有一个pa_hostapi_skeleton.c文件

(pa_hostapi_skeleton.c provides a starting point for implementing support for a new host API with PortAudio. The idea is that you copy it to a new directory inside /hostapi and start editing.)

所以试着在opensmile-2.3.0\thirdparty\portaudio\src\common新建一个空的pa_skeleton.c文件,再Build Solution一下。

7.如果报错error LNK1104: cannot open file 'ksguid.lib' 

error LNK1104: cannot open file 'ksguid.lib'    D:\Software\OpenSMILE\opensmile-2.3.0\thirdparty\portaudio\build\msvc\LINK    portaudio

参考:https://blog.csdn.net/ww506772362/article/details/92651485

portaudio--右键--properties--Configuration Properties->C/C++ ->Preprocessor->Preprocesser Definitions中添加PA_WDMKS_NO_KSGUID_LIB,然后再Rebuild一下

8.若报error:Cannot open include file:'portaudio.h':No such file or directory

编译opensmile支持portaudio

 经搜索发现portaudio.h在opensmile-2.3.0\thirdparty\portaudio\include下,

在openSmileLibPortaudio--右键--Configuration Properties--C/C++/General--Additional Incluse Directories中插入此路径,

添加相对路径..\..\include,如果不行就加绝对路径

编译opensmile支持portaudio

编译opensmile支持portaudio

openSmileLib--右键--Configuration Properties--C/C++/General--Additional Incluse Directories中插入路径

编译opensmile支持portaudio

9.如果报错error LNK1181: cannot open input file '../../../msvcbuild/portaudio_x86.lib'   

编译opensmile支持portaudio

将D:\Software\OpenSMILE\opensmile-2.3.0\msvcbuild下的三个文件,复制到D:\Software\OpenSMILE\msvcbuild下

 编译opensmile支持portaudio

10.如果出现error C1041:cannot open program database

编译opensmile支持portaudio

 参考:https://www.cnblogs.com/amwuau/p/12757410.html

将openSmileLibLibsvm--右键--C/C++--General--Debug Information Format 改为C7 commpatible(/Z7)

编译opensmile支持portaudio

 

编译成功后在D:\Software\OpenSMILE\msvcbuild 中会出现

编译opensmile支持portaudio

相关文章: