none
How to add a speech grammar grxml to a Visual C++ 2010 project RRS feed

  • Question

  • Hi

    I am trying to create and compile a new project same as “SpeechBasics-D2D” written in C++ and using Visual Studio C++ 2010.

    “SpeechBasics-D2D” comes in its solution with a grammar file called “SpeechBasics-D2D.grxml”. When you compile this solution, this file is copied at Debug folder together with the app.

    I have been looking for options, properties or something like that in Visual Studio that indicates file will be copied to runtime folder, or similar.

    Since I have the same file in my new project and when calling function “m_pSpeechGrammar->LoadCmdFromFile(GrammarFileName, SPLO_STATIC);” always fail I want to know how to add a new grxml file to my project and link it correctly.

    I have the file in the solution directory and debug directory. I have also tried to copy to an absolute path such “C:\*.grxml” and it fails.

     

    Does anyone could help me?

     

    Thanks in advance

     

    Wednesday, May 29, 2013 11:00 AM

Answers

  • In the Visual Studio project(.vcxproj) file, you will see an attribute called <CopyToOutputDirectory>

    <ItemGroup>
        <None Include="Kinect.ico" />
        <None Include="SpeechBasics-D2D.grxml">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
    </ItemGroup>

    You may want to ask over in the Visual Studio forums on how to set this as part of your import. Additionally, you could build scripts that copy the files as a post build.

    Friday, May 31, 2013 5:57 PM

All replies

  • In the Visual Studio project(.vcxproj) file, you will see an attribute called <CopyToOutputDirectory>

    <ItemGroup>
        <None Include="Kinect.ico" />
        <None Include="SpeechBasics-D2D.grxml">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
    </ItemGroup>

    You may want to ask over in the Visual Studio forums on how to set this as part of your import. Additionally, you could build scripts that copy the files as a post build.

    Friday, May 31, 2013 5:57 PM
  • Thanks, that has solved my problem. Also using a post build step works.
    Monday, June 3, 2013 9:29 AM