Speech SDK error

hello!I just download Microsoft Speech SDK,set up,then set Option->Directoris, and I use this code:
1
2
3
#include <sapi.h>
#pragma comment(lib,"ole32.lib") 
#pragma comment(lib,"sapi.lib")  

the main code is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int main(int argc, char* argv[]) 
{ 
ISpVoice * pVoice = NULL;


if (FAILED(::CoInitialize(NULL))) 
return FALSE;

 
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice); 
if( SUCCEEDED( hr ) ) 
{ 
hr = pVoice->Speak(L"Hello world", 0, NULL); 
pVoice->Release(); 
pVoice = NULL; 
}

 
::CoUninitialize(); 
return TRUE; 
}

but it says "c:\program files\microsoft visual studio\vc98\include\rpcndr.h(58) : fatal error C1189: #error : incorrect <rpcndr.h> version. Use the header that matches with the MIDL compiler."
1
2
3
4
5
#ifdef __REQUIRED_RPCNDR_H_VERSION__
    #if ( __RPCNDR_H_VERSION__ < __REQUIRED_RPCNDR_H_VERSION__ )
        #error incorrect <rpcndr.h> version. Use the header that matches with the MIDL compiler.
    #endif 
#endif 

What should I do?
did you try including windows.h before everything else?
The code works for me using VS 2010 SP1 and Speech SDK 11 using windows 7 (no setup was needed whatsoever).

From this error message
c:\program files\microsoft visual studio\vc98\include\rpcndr.h
I assume you are using VC6, which is not supported.
Last edited on
Topic archived. No new replies allowed.