【转】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编译错误解决方案

    原文连接地址:http://blog.csdn.net/believenow_notfuture/article/details/52191229 [转]SAPI 包含sphelper.h编译错误解决 ...

  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. Caffe 工程的一些编译错误以及解决方案

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

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

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

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

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

  8. 《转载》使用org.w3c.dom.Element的setTextContent()、getTextContent()方法时出现编译错误

    今天在更新项目后进行编译时,出现如下错误一堆: 编译错误 Google之,在stackoverflow上看到如下的解决方法: I came here with the same problem. Ev ...

  9. 【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进行编译 ...

随机推荐

  1. 【自定义IK词典】Elasticsearch之中文分词器插件es-ik的自定义词库

    Elasticsearch之中文分词器插件es-ik 针对一些特殊的词语在分词的时候也需要能够识别 有人会问,那么,例如: 如果我想根据自己的本家姓氏来查询,如zhouls,姓氏“周”.      如 ...

  2. 2018 Machine Learning

    2018/8/13 线性模型(西瓜书P53~P73) Optimizer https://blog.csdn.net/u012151283/article/details/78154917 2018/ ...

  3. Springboot统一参数验证方式

    Springboot统一验证方式 在提供http api 接口形式的服务中,通过都会传递参数为一个对象.我们需要对这个对象的各个字段进行校验.来判断是否为合法值. 传统的方式为自己获取每个字段的值,自 ...

  4. HDU 6127 Hard challenge(扫描线)

    http://acm.hdu.edu.cn/showproblem.php?pid=6127 题意: 有n个点,每个点有一个$(x,y)$坐标和一个权值,任意两点之间都有连线,并且连线的权值为两个顶点 ...

  5. JavaScript权威指南--脚本化文档

    知识要点 脚本化web页面内容是javascript的核心目标. 第13章和14章解释了每一个web浏览器窗口.标签也和框架由一个window对象所示.每个window对象有一个document对象, ...

  6. 使用排序数组/链表/preorder构建二叉搜索树

    2018-08-13 11:29:05 一.Convert Sorted Array to Binary Search Tree 问题描述: 问题求解: public TreeNode sortedA ...

  7. 流氓 2345.com的新动态及解决方法

    安装了[电脑公司]的Win7_SP1之后, IE的主页被绑架. 症状是先转到 IE959.com,然后自动跳转到 www.2345.com 网上当然有很多例子了,可是都没有效果. 1. 更改IE设置没 ...

  8. 基于netty框架的socket长连接负载均衡解决方案

    socket通讯的单机瓶颈 物联网的项目socket使用方式有两种: 短连接的socket请求 维持socket长连接的请求 对于socket短链接来说就好比是http请求,请求服务器,服务器返回数据 ...

  9. [.NET开发] C#实现的SQL备份与还原功能示例

    本文实例讲述了C#实现的SQL备份与还原功能.分享给大家供大家参考,具体如下: //记得加 folderBrowserDialog1 openFileDialog1 控件 using System.D ...

  10. 1月28日周日,更新ruby到2.5.0版,rvm更新。

    在学习Array的方法的时候,发现文档concat方法可以进行多个数组的添加,而我的不行,猜测是ruby版本没有更新. 查询2.31ruby版本的concat方法,果然和2.5版本的不一样. 于是准备 ...