如题,在VS2010下编译 speex-1.2rc1。
参考了一些网上的资料,把自己编译speex-1.2rc1过程中遇到的一些问题做总结。。。好记性不如烂笔头O(∩_∩)O~。
1、下载speex-1.2rc1(兼容以前的项目)
下载链接为:http://www.speex.org/downloads/
2、解压到本地命令,打开文件speex-1.2rc1\win32\VS2008\libspeex.sln,因为该工程是VS2008版本的,会自动转换为VS2010版本的,点 "下一步" 直到结束。
问题来了,转换完成后,提示
“......\speex-1.2rc1\win32\VS2008\libspeex\libspeex.vcproj' has failed to load.”
再看下面:
转换报告 - libspeex\libspeex.vcproj: | ||||||
Converting project file 'D:\OneFiles\Audio and video\speex\speex-1.2rc1\win32\VS2008\libspeex\libspeex.vcproj'. | ||||||
Failed to upgrade platform 'Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'. Please make sure you have it installed under '%vctargetspath%\platforms\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)' | ||||||
VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings. | ||||||
Failed to upgrade 'Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'. Please make sure you have the corresponding platform installed under '%vctargetspath%\platforms\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)' | ||||||
The project configuration dimension name/value "(Platform, Win32)" was not found in the project manifest. | ||||||
项目升级失败。 |
好了,百度之——据网上资料显示,这是VS2010不支持的一些VS2008上面的组件,按说可以注释掉,直接注释之。。。。。。
3、编辑文件libspeex.vcproj,把“Windows Mobile 5.0 Pocket PC SDK (ARMV4I)”相关的configuration注释掉
注意,要把
<Configuration>
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
.. ...
</Configuration>
里面的内容全部注释掉。。。
4、编译。。。
好吧,会发现少了libogg库,到这里http://xiph.org/downloads/下载1.3.2版本的
5、解压到本地,打开项目文件:libogg-1.3.2\win32\VS2010\libogg_dynamic.sln ( or libogg_static.sln ),只有两个文件,编译后拷贝库文件、头文件到speex目录下,设置好libogg的包含路径和库文件路径。。。
6、再次编译speex,提示找不到文件testresample.c,搜索发现居然没有这个文件,果断把它 “从项目中排除”。。。
7、再次编译,到speexenc提示。。。
PS:此时已经生成库libspeex.lib、libspeexdsp.lib ,所以下面的可以跳过。。。
无法解析的外部符号_speex_bits_write。。。找了半天,这是libspeex里面的文件好吗,原来是libspeex的库文件找不到了。。。把libspeex.lib添加到speexenc项目。。。
8、再次编译,有以下几个小问题:
a、peexdec、speexenc、testencs、项目要添加libspeex.lib的依赖。。。
b、speexdec、testenc、testenc_uwb、testenc_wb项目错误:C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(3051,5): error MSB4006: 涉及目标“GetCopyToOutputDirectoryItems”的目标依赖项关系图中存在循环依赖项。
参考这个链接:http://www.xuebuyuan.com/1215445.html
解决办法:由于程序只是用C++程序,所以不会存在调用net组件。修改工程属性配置:把copy local改成false变可以了。。。
9、附上我的工程链接。。。
http://download.youkuaiyun.com/detail/woyaole/9519686