Archived

This topic is now archived and is closed to further replies.

kghln

Text2Speech SAPI Tutorial Strange Problem!

Recommended Posts

Hi, I was just trying the samples from the tutorial Text-to-speech with SAPI and they work just fine in debug mode, but when I change to release mode They don’t even compile (and the same error for build). I get a the following error: Fatal error C1010: unexpected end of file while looking for precompiled header directive When the code is just the code from sample1: // SAPI Sample 1.cpp : Defines the entry point for the console application. // #include <sapi.h> int main ( int NumOfArguments, char** Argument ) { ISpVoice* Voice = NULL; // The voice interface // Initialize COM CoInitialize ( NULL ); // Create the voice interface object CoCreateInstance ( CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void**)&Voice ); // Speak! Voice -> Speak ( L"Hi!!!", SPF_DEFAULT, NULL ); // Shutdown the voice if ( Voice != NULL ) Voice -> Release (); Voice = NULL; // Shutdown COM CoUninitialize (); return 0; } /// Does anyone have any idea of what is happening? Thank you.

Share this post


Link to post
Share on other sites
Debug project settings and Release project settings are two separate entities.

So if you make changes to debug, like add libraries, set up compiler options, etc, you will need to do the same for Release as well..

In your case, go to C++/Code-generation/Precompiled headers --> Set this to either "automatically generate", or "not using precompiled headers". It is presently set to "Using precompiled headers", if I am not mistaken.

www.cppnow.com

Share this post


Link to post
Share on other sites
In fact i''ve just discovered that it didnt work because
i didnt have this :

#include "stdafx.h"


To solve the problem i''ve just created a new simple win32 console app just like the hello world and then pasted the code from the tutorial and it worked fine.

but thanks for the reply.

Share this post


Link to post
Share on other sites