author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|
erhopf |
cognitive-services |
include |
10/15/2020 |
erhopf |
To create a Visual Studio project for C++ desktop development, you need to:
- Set up Visual Studio development options.
- Create the project.
- Select the target architecture.
- Install the Speech SDK.
To start, make sure you're set up correctly in Visual Studio for C++ desktop development:
-
Open Visual Studio 2019 to display the start window.
-
Select Continue without code to go to the Visual Studio IDE.
-
From the Visual Studio menu bar, select Tools > Get Tools and Features to open Visual Studio Installer and view the Modifying dialog.
-
On the Workloads tab, under Windows, find the Desktop development with C++ workload. If the check box next to that workload isn't already selected, select it.
-
On the Individual components tab, find the NuGet package manager check box. If the check box isn't already selected, select it.
-
In the corner, select the button labeled either Close or Modify. The button name varies depending on whether you selected any features for installation.
If you select Modify, installation begins. The process might take a while.
-
Close Visual Studio Installer.
Next, create your project and select the target architecture:
-
On the Visual Studio menu bar, select File > New > Project to display the Create a new project window.
-
Find and select Console App. Make sure that you select the C++ version of this project type, as opposed to C# or Visual Basic.
-
Select Next.
-
In the Configure your new project dialog, in Project name, enter helloworld.
-
In Location, go to and select (or create) the folder where you want to save your project, and then select Create.
-
Select your target platform architecture. On the Visual Studio toolbar, find the Solution Platforms drop-down box. If you don't see it, select View > Toolbars > Standard to display the toolbar that contains Solution Platforms.
If you're running 64-bit Windows, select x64 in the drop-down box. 64-bit Windows can also run 32-bit applications, so you can choose x86 if you prefer.
Finally, install the Speech SDK NuGet package and reference the Speech SDK in your project:
-
In Solution Explorer, right-click your solution, and then select Manage NuGet Packages for Solution to go to the NuGet - Solution window.
-
Select Browse.
-
In Package source, select nuget.org.
-
In the Search box, enter Microsoft.CognitiveServices.Speech. Choose that package after it appears in the search results.
-
In the package status pane next to the search results, select your helloworld project.
-
Select Install.
-
In the Preview Changes dialog, select OK.
-
In the License Acceptance dialog, view the license, and then select I Accept. The package installation begins. When installation is complete, the Output pane displays a message that's similar to the following text:
Successfully installed 'Microsoft.CognitiveServices.Speech 1.15.0' to helloworld
.