(转载)SAPI 包含sphelper.h编译错误解决方案
【转】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编译错误解决方案的更多相关文章
- SAPI 包含sphelper.h编译错误解决方案
原文连接地址:http://blog.csdn.net/believenow_notfuture/article/details/52191229 [转]SAPI 包含sphelper.h编译错误解决 ...
- Cocos2dx 代码中包含中文导致编译错误的问题解决方法
从网上下载一个cocos2dx的源码,是IOS版本的,我将其迁移到windows 7下 ,用VS2010编译,出现一堆的C2001错误: 1>d:\cocos2d-x-2.2.6\mygame\ ...
- because it is not a variable 编译错误解决方案
1,将Stuct换为class 2,使用中间变量, 如Point p=new Point(x,y); this.Location=p; 而不能直接给struct赋值,因为值类型是不能改变的,必须生成新 ...
- centos type.h 编译错误问题
# ifndef __int8_t_defined # define __int8_t_defined __intN_t (, __QI__); __intN_t (, __HI__); __intN ...
- Caffe 工程的一些编译错误以及解决方案
本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/51371936 整理一下最近遇到caff ...
- VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h
VS2010编译错误:是否忘记了向源中添加“#include "stdafx.h 编译提示:fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加“# ...
- php源码编译常见错误解决方案大全
php源码编译常见错误解决方案大全http://www.cnlvzi.com/index.php/Index/article/id/143 在CentOS编译PHP5的时候有时会遇到以下的一些错误信息 ...
- 《转载》使用org.w3c.dom.Element的setTextContent()、getTextContent()方法时出现编译错误
今天在更新项目后进行编译时,出现如下错误一堆: 编译错误 Google之,在stackoverflow上看到如下的解决方法: I came here with the same problem. Ev ...
- 【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进行编译 ...
随机推荐
- Win7上安装WMware虚拟机和Ubuntu操作系统
效果图: 问题拾遗: 一.如何划分一个新硬盘空间? 参考链接:如何新建磁盘空间 效果图: 我划分了20G的内存空间给Ubuntu的硬盘空间.一般来说15G就够用了. 二.VMware上拷贝Ubuntu ...
- 第四次程序设计作业 C++计算器计算及命令行的使用 前缀表达式方法实现
关键词:前缀中缀后缀表达式 波兰式 命令行 myGithub 一.前言 很有意思的开发和学习经历,从刚刚开始看到作业思考半天到现在的Debug过程,对我来说都或多或少有所提升. 也许这个时候自己挺迷茫 ...
- 51nod 1444 破坏道路(最短路)
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1444 题意: 思路: 哇,思路爆炸. 因为每条边的权值都为1,所以可以直 ...
- HDU 2586 How far away ?(LCA在线算法实现)
http://acm.hdu.edu.cn/showproblem.php?pid=2586 题意:给出一棵树,求出树上任意两点之间的距离. 思路: 这道题可以利用LCA来做,记录好每个点距离根结点的 ...
- idea oracle反向工程生成实体类
1. 选择View-Tool Window- Database 2. 配置数据库信息 提示:配置完成后可以通过idea进行sql查询等操作 3.在项目中创建hbernate.cfg.xml文件, 在r ...
- [IOS][sqlite][SQL][数据库]SQL基本语句大全
参考:http://www.cnblogs.com/yubinfeng/archive/2010/11/02/1867386.html 一.基础 1.说明:创建数据库CREATE DATABASE d ...
- flash破解工具/flash decompiler
如果想比较方便地参观浏览一下flash(swf)文件里面的内容,推荐使用国外免费开源的工具JPEXS Free Flash Decompiler. 传送门:https://www.free-decom ...
- URAL 1501 Sense of Beauty
URAL 1501 思路: dp+记忆化搜索 状态:dp[i][j]表示选取第一堆前i个和第二堆前j的状态:0:0多1个 1:0和1相等 2:1 ...
- URAL 1303 Minimal Coverage
URAL 1303 思路: dp+贪心,然后记录路径 mx[i]表示从i开始最大可以到的位置 sufmx[i]表从1-i的某个位置开始最大可以到达的位置 比普通的贪心效率要高很多 代码: #inclu ...
- Codeforces 388A - Fox and Box Accumulation
388A - Fox and Box Accumulation 思路: 从小到大贪心模拟. 代码: #include<bits/stdc++.h> using namespace std; ...