我正在尝试使用 C++ 版本的语音语音识别 API。它是一个用 Java 构建的 API,也支持 C++。但是,每当我尝试执行它时,我都会收到错误消息
C:\Users\yohan\Documents\Extra C++ Libs\Voice Recognition - Voce API\voce-0.9.1\src\c++\voce.h:34: error: C1083: Cannot open include file: 'jni.h': No such file or directory
这是我的 .pro 内容
#-------------------------------------------------
#
# Project created by QtCreator 2013-04-26T12:59:05
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = Tired
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:/opencv/build/include
INCLUDEPATH += C:/opencv/build/include/opencv
INCLUDEPATH += C:/Program Files/Java/jdk1.7.0/include/
INCLUDEPATH += C:/Program Files/Java/jdk1.7.0/include/win32
LIBS += C:/opencv/build/x86/vc9/lib/opencv_calib3d240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_contrib240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_core240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_features2d240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_flann240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_highgui240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_imgproc240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_objdetect240.lib
LIBS += C:/opencv/build/x86/vc9/lib/opencv_video240.lib
HEADERS +=
这是Main.cpp的代码
#include "C:/Users/yohan/Documents/Extra C++ Libs/Voice Recognition - Voce API/voce-0.9.1/src/c++/voce.h"
int main()
{
}
下面给出voce.h的一小部分代码
#ifndef VOCE_H
#define VOCE_H
// This file contains a C++ interface for Voce's Java functions. All of
// the Java methods in Voce's API are instance methods, so we don't need
// to handle class methods here. For documentation on the specific
// functions, refer to the API documentation for the Java source.
#include <jni.h>
#include <iostream>
#include <string>
/// The namespace containing everything in the Voce C++ API.
namespace voce
{
#ifdef WIN32
const std::string pathSeparator = ";";
#else
const std::string pathSeparator = ":";
#endif
/// Contains things that should only be accessed within Voce.
namespace internal
{
/// Global instance of the JNI environment.
JNIEnv* gEnv = NULL;
/// Global instance of the Java virtual machine.
JavaVM *gJVM = NULL;
//Code Continues..........................................
我怎样才能摆脱这个错误?我正在使用 QT,它是使用 Visual Studio 2010 编译器的最新版本。