CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Dec 2013
    Posts
    6

    How to Setup VOCE (Voice Recognition API) C++

    All day long I tried figuring out how to setup VOCE (http://voce.sourceforge.net).

    I am using VS 2010.

    What I did:

    * Downloaded JDK
    * Downloaded the VOCE, extracted and put in c:
    * Opened VS and in properties->Vc++ Direcotories:
    * In Include Directories i added: C:\voce-0.9.1\src\c++, C:\Program * Files\Java\jdk1.7.0_45\include, C:\Program Files\Java\jdk1.7.0_45\include\win32
    * In Library Directories i added: C:\voce-0.9.1\lib, C:\Program * Files\Java\jdk1.7.0_45\lib

    ALSO: I didn't get what i suppose to do with C:\voce-0.9.1\lib everything there * is winrars

    Tried to compile a sample file and it gives me the error:
    Testing.obj : error LNK2001: unresolved external symbol _imp_JNI_CreateJavaVM@12

    (I googled it but everything i try didn't work)

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by robi9011235 View Post
    Tried to compile a sample file and it gives me the error:
    Testing.obj : error LNK2001: unresolved external symbol _imp_JNI_CreateJavaVM@12
    You're also supposed to give the name of the library to the linker, not just give the path where libraries are found. Nowhere in your description of what you did says anything about giving the name of the library to the linker.

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Dec 2013
    Posts
    6

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by Paul McKenzie View Post
    You're also supposed to give the name of the library to the linker, not just give the path where libraries are found. Nowhere in your description of what you did says anything about giving the name of the library to the linker.

    Regards,

    Paul McKenzie
    I don't really get it.
    How can I do that?

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by robi9011235 View Post
    I don't really get it.
    How can I do that?
    I don't have VS in front of me right now, but the steps are something like go to project properties, select linker, then input then put in the name(s) of whatever libraries you need.

    You can also just add it to the project by selecting project, insert existing item, or something close to that.

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by robi9011235 View Post
    I don't really get it.
    So how is the linker to know the name of the library it needs to open, find your functions, and link? A directory isn't going to give that information.

    Linker->Input->Additional Dependencies

    There is where you give the name of the library.
    In Include Directories i added: C:\voce-0.9.1\src\c++, C:\Program * Files\Java\jdk1.7.0_45\include, C:\Program Files\Java\jdk1.7.0_45\include\win32
    And what if in your source code, you never #included any of the files that are associated with VOCE? See the similarities? If you just give an #include path and never actually state in your source code to #include a file that is needed, you get a compiler error. Same here -- you never stated to the linker what library you want to link -- you only gave the path to where the library files are found.

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; December 28th, 2013 at 08:51 PM.

  6. #6
    Join Date
    Dec 2013
    Posts
    6

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by Paul McKenzie View Post
    So how is the linker to know the name of the library it needs to open, find your functions, and link? A directory isn't going to give that information.

    Linker->Input->Additional Dependencies

    There is where you give the name of the library.
    And what if in your source code, you never #included any of the files that are associated with VOCE? See the similarities? If you just give an #include path and never actually state in your source code to #include a file that is needed, you get a compiler error. Same here -- you never stated to the linker what library you want to link -- you only gave the path to where the library files are found.

    Regards,

    Paul McKenzie
    I did what you said. I put: (C:\voce-0.9.1\src\c++, C:\Program Files\Java\jdk1.7.0_45\include, C:\Program Files\Java\jdk1.7.0_45\include\win32) in
    Linker -> Additional library directories and it still not working.
    ):
    What about: "I didn't get what i suppose to do with C:\voce-0.9.1\lib everything there is winrars"
    I really appreciate your help, thank you!

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by robi9011235 View Post
    I did what you said. I put: (C:\voce-0.9.1\src\c++, C:\Program Files\Java\jdk1.7.0_45\include, C:\Program Files\Java\jdk1.7.0_45\include\win32) in
    Linker -> Additional library directories and it still not working.
    ):
    What about: "I didn't get what i suppose to do with C:\voce-0.9.1\lib everything there is winrars"
    I really appreciate your help, thank you!
    That's not what he said. He said you need to tell it specifically which .lib files.

  8. #8
    Join Date
    Dec 2013
    Posts
    6

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by GCDEF View Post
    That's not what he said. He said you need to tell it specifically which .lib files.
    How do i do that?
    I can't add filed to Linker->Additional Library Directories, only folders

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by robi9011235 View Post
    How do i do that?
    I can't add filed to Linker->Additional Library Directories, only folders
    I already told you

  10. #10
    Join Date
    Dec 2013
    Posts
    6

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by GCDEF View Post
    I already told you
    Oh now i get it!
    It is compiling successfully, but there is a run-time error, saying it don't find jvm.dll

  11. #11
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to Setup VOCE (Voice Recognition API) C++

    Quote Originally Posted by robi9011235 View Post
    Oh now i get it!
    It is compiling successfully, but there is a run-time error, saying it don't find jvm.dll
    Does jvm.dll exiist?

  12. #12
    Join Date
    Oct 2014
    Posts
    4

    Re: How to Setup VOCE (Voice Recognition API) C++

    I'm having exactly the same issue. I have no experience with JNI.
    Following the above steps, I have managed to reach the point that jvm.dll is needed.
    I copied inside the folder where the .exe file is, but now I get the message that JVM cannot be initialized.
    Any thoughts?

  13. #13
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to Setup VOCE (Voice Recognition API) C++

    Did you try to read about similar problems here?
    Victor Nijegorodov

  14. #14
    Join Date
    Oct 2014
    Posts
    4

    Re: How to Setup VOCE (Voice Recognition API) C++

    Just did :P
    I had to modify the system variables in order to work.
    Thanks a lot!!

  15. #15
    Join Date
    Oct 2014
    Posts
    4

    Re: How to Setup VOCE (Voice Recognition API) C++

    Next, probably stupid, question :P
    I try to initialize voce with the init() function, but it cannot find the grammar path. I' ve tried every possible way.
    Absolute path, relative path according to the location of jar files, relative path according to my project location.
    Nothing seems to work. Any help?
    Last edited by SteveShady; October 18th, 2014 at 09:30 AM.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured