原文连接地址:http://blog.csdn.net/believenow_notfuture/article/details/52191229

【转】SAPI 包含sphelper.h编译错误解决方案 在使用Microsoft Speech SDK 5.1开发语音识别程序时,包含了头文件“sphelper.h”和库文件“sapi.lib”。编译时出错: 1>c:/program files/microsoft speech sdk 5.1/include/sphelper.h(769) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:/program files/microsoft speech sdk 5.1/include/sphelper.h(1419) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:/program files/microsoft speech sdk 5.1/include/sphelper.h(2373) : error C2065: 'psz' : undeclared identifier 1>c:/program files/microsoft speech sdk 5.1/include/sphelper.h(2559) : error C2440: 'initializing' : cannot convert from 'CSpDynamicString' to 'SPPHONEID *' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1>c:/program files/microsoft speech sdk 5.1/include/sphelper.h(2633) : error C2664: 'wcslen' : cannot convert parameter 1 from 'SPPHONEID *' to 'const wchar_t *' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 搜索了一圈,根据大家的经验汇总,应该是Speech代码编写时间太早,语法不严密。而VS2005对于语法检查非常严格,导致编译无法通过。修改头文件中的以下行即可正常编译:

Ln 769 const ulLenVendorPreferred = wcslen(pszVendorPreferred);

             const unsigned long ulLenVendorPreferred = wcslen(pszVendorPreferred);

Ln 1418 static CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX)

              static HRESULT CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX)

Ln 2372 for (const WCHAR * psz = (const WCHAR *)lParam; *psz; psz++) {}

             const WCHAR * psz; for (psz = (const WCHAR *)lParam; *psz; psz++) {}

Ln 2559 SPPHONEID* pphoneId = dsPhoneId;

              SPPHONEID* pphoneId = (SPPHONEID*)((WCHAR *)dsPhoneId);

Ln 2633 pphoneId += wcslen(pphoneId) + 1;

              pphoneId += wcslen((const wchar_t *)pphoneId) + 1;

好了,编译通过,下面可以正式编写程序逻辑了。

SAPI 包含sphelper.h编译错误解决方案的更多相关文章

  1. (转载)SAPI 包含sphelper.h编译错误解决方案

    [转]SAPI 包含sphelper.h编译错误解决方案 在使用Microsoft Speech SDK 5.1开发语音识别程序时,包含了头文件“sphelper.h”和库文件“sapi.lib”.编 ...

  2. Cocos2dx 代码中包含中文导致编译错误的问题解决方法

    从网上下载一个cocos2dx的源码,是IOS版本的,我将其迁移到windows 7下 ,用VS2010编译,出现一堆的C2001错误: 1>d:\cocos2d-x-2.2.6\mygame\ ...

  3. because it is not a variable 编译错误解决方案

    1,将Stuct换为class 2,使用中间变量, 如Point p=new Point(x,y); this.Location=p; 而不能直接给struct赋值,因为值类型是不能改变的,必须生成新 ...

  4. centos type.h 编译错误问题

    # ifndef __int8_t_defined # define __int8_t_defined __intN_t (, __QI__); __intN_t (, __HI__); __intN ...

  5. VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h

    VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h 编译提示:fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加“# ...

  6. php源码编译常见错误解决方案大全

    php源码编译常见错误解决方案大全http://www.cnlvzi.com/index.php/Index/article/id/143 在CentOS编译PHP5的时候有时会遇到以下的一些错误信息 ...

  7. Caffe 工程的一些编译错误以及解决方案

    本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/51371936 整理一下最近遇到caff ...

  8. 【Redis】编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

    [Redis]编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory 在安装redis进行编译 ...

  9. VS2008编译错误:error C2065: 'PMIB_TCPSTATS' : undeclared identifier c:\program files (x86)\microsoft sdks\windows\v7.0a\include\iphlpapi.h 411

    安装了VS2008编译之前的程序,结果出现了编译错误,以为是VS2008的Sp1补丁没装好,重装补丁后还是不行,编译错误如下: 双击错误会定位在iphlpapi.h中, 一个可行的解决办法是:把iph ...

随机推荐

  1. spring使用set方法注入的常见类型写法

    首先配置spring的pom.xml文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" ...

  2. 怎样下载JDBC驱动

    MySQL官网: https://www.mysql.com/ 请注意: 需要把mysql-connector-java-5.1.45-bin.jar放到C:\JMeter\apache-jmeter ...

  3. web自动化原理揭秘

    做过两年自动化测试的小伙伴说web自动化测试真的不难,无非就是一些浏览器操作,页面元素操作,常规的情况很容易处理,再学一学特殊元素的处理,基本就能应付项目的测试了. 这个话倒没错,但是真正要学好自动化 ...

  4. Python 的非正式介绍

    在下面的例子中,通过提示符 (>>> 与 ...) 的出现与否来区分输入和输出:如果你想复现这些例子,当提示符出现后,你必须在提示符后键入例子中的每一个词:不以提示符开头的那些行是解 ...

  5. Python入门(3)

    一.列表 列表是用来储存和处理多个数据的数据类型,我们可以像下面这样来创建一个列表: my_list = [1, 2, 3] 列表和数学中的集合很像,但是,列表中的数据是可以重复,并且他们是有序的,列 ...

  6. OpenPAI大规模人工智能平台安装部署文档

    环境要求: 如果需要图形界面,需要在Ubuntu系统安装,否则centos系统安装时是没有问题的(web端和命令行进行任务提交) 安装过程需要有另外一台控制端机器(注意:区别于集群所在的任何一台服务器 ...

  7. Using APIs in Your Ethereum Smart Contract with Oraclize

    Homepage Coinmonks HOMEFILTER ▼BLOCKCHAIN TUTORIALSCRYPTO ECONOMYTOP READSCONTRIBUTEFORUM & JOBS ...

  8. 编译安装hadoop2.6.3

    一.安装环境 1.1  JAVA  安装java1.7 下载jdk1.7: [root@node1~]# wget http://download.oracle.com/otn-pub/java/jd ...

  9. Median Weight Bead(最短路—floyed传递闭包)

    Description There are N beads which of the same shape and size, but with different weights. N is an ...

  10. 第十七次ScrumMeeting会议

    第十七次Scrum Meeting 时间:2017/12/7 地点:线上+主235 人员:蔡帜 王子铭 游心 解小锐 王辰昱 李金奇 杨森 陈鑫 赵晓宇 照片: 目前工作进展 名字 今日 明天的工作 ...