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)
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
robi9011235
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
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
Paul McKenzie
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?
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
robi9011235
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.
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
robi9011235
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.
Quote:
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
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
Paul McKenzie
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!
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
robi9011235
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.
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
GCDEF
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
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
robi9011235
How do i do that?
I can't add filed to Linker->Additional Library Directories, only folders
I already told you
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
GCDEF
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
Re: How to Setup VOCE (Voice Recognition API) C++
Quote:
Originally Posted by
robi9011235
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?
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?
Re: How to Setup VOCE (Voice Recognition API) C++
Did you try to read about similar problems here?
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!!
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?