I am using version 4.9.2 of UE4, and Visual Studio Community 2013. I am trying to get voce speech recognition library (http://voce.sourceforge.net/) working in my UE4 project, and having trouble with the linker when I try to build my project. The library uses JNI to call native Java code from C++, which needs the linker to link the “jvm.lib” from my java virtual machine in to the build.
I have it working in a standalone console application in Visual Studio, to get that working I had to add “jvm.lib” into the build by adding to in the “Properties->Linker->Input->Additional Dependencies” in VS, as well as adding the path to the “Properties->Linker->General->Additional Library Directories”. (this is my first attempt to get JNI working, so it took some research to get that far.)
However in the project that was created for me from the UE4 side, I open up the same menu “Project->Properties” that whole menu (Properties->Linker) is just not present.
In UE4 I created this as blank C++ project, then overrode the “Actor” class making a “ListeningActor.cpp” and a “ListeningActor.h”, launched VC++ from UE, then I added the
paths to the include files for voce and java into my “Properties->Configuration Properties->VC++ Directories->General->Include Directories” (which worked insomuch as I was able to get the build to find them)
The build error I am getting is…
error LNK2019: unresolved external symbol __imp__JNI_CreateJavaVM@12 referenced in function "void __cdecl voce::init(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool,bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?init@voce@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N100@Z)
that’s the same error I was getting on my console app before I added the “jvm.lib” into my Linker-Additional Dependencies properties entry in CV++.
I need some advice on how to proceed. Is there some way to tell VC++ to show the rest of the project properties panel? Why is it different if I create this project from within UE4?