Click here to Skip to main content
15,924,317 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am having some problems getting my program to work while using the code from this tutorial http://www.codeproject.com/KB/dotnet/Speech_Sample.aspx#_comments[^]

I have followed the tutorial and made a project with only that code, which works. Its when I then put it into my project I get this error:

error C3083: 'Speech': the symbol to the left of a '::' must be a type<br />
error C2039: 'Synthesis' : is not a member of 'System'<br />
error C2871: 'Synthesis' : a namespace with this name does not exist


The errors are coming from the line that I added in at the top:

using namespace System::Speech::Synthesis;

This then create more errors due to things not being defined etc..

I've googled these errors and have not found any solutions that are similar or that I understand. I have just started using Visual C++.

Any help would be greatly appreciated! Thank you.
Posted
Updated 23-Mar-11 13:11pm
v2

Most likely, you failed to add the reference to the assembly System.Speech to the project. Also, the project should have "/clr" option.

I should say it's not very nice to post some errors without relevant code. Do you want to force CodeProject members into guesswork. Also, I have to change your tag from C++ to C++/CLI. You should understand: those are different languages, even though you can uses them in the same project.

Please next time formulate the Question thoroughly.

—SA
 
Share this answer
 
Comments
amck77 24-Mar-11 17:17pm    
Thank you for your comment about adding the reference. I have it working now.

Also, I have no idea what is what, I am in the process of learning as I am going along. I am doing a university project where our programmer dropped out so I am learning as I go, on a tight schedule.. As far as I was aware I am using C++ and recently learnt this speech is something to do with dot net.

Secondly, I posted a link to the very code I was having trouble with as it was a tutorial posted on this web site. If I was to post my own code, then I would not be sure what to give you without giving you a large mass of code which the forum rules also said I should not do.

I thank you again for your advise. I now feel I can not post any more of my queeries that I am struggling with for fear I am in the wrong.
Sergey Alexandrovich Kryukov 24-Mar-11 21:23pm    
I think you need to make a separate prototype of the speech-related sub-system if the form of "walking skeleton" and operate with it until this part of technology is clear to you. As a side product, you will have something minimal which could be suitable for posting if you need some help from CodeProject.
--SA
That isnt really C++ example. You need the .NET framework.
But if you are interested in speech programming, you should download the speech SDK (SAPI5). This contains a lot of examples too. Sorry i cant give you a link (use internet search).
Regards.
 
Share this answer
 
Comments
amck77 23-Mar-11 19:19pm    
Thanks for your reply!

I've got the sapi SDK and some other ones from a few different tutorials I've tried. The tutorial I posted was the only one I got to work in a separate project file. But I don't understand the error I'm getting when I add it to my own project. I'm sure I've set it up in the same way.. So I don't see why its not working.

I tried commenting out the include files I've added through my project to see if any of them were creating issuses, but this did not help. Apart from that I have no idea what to try next...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900