C代码中未定义的符号'_JNI_CreateJavaVM' [英] undefined symbol '_JNI_CreateJavaVM' in C code

查看:92
本文介绍了C代码中未定义的符号'_JNI_CreateJavaVM'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JNIEnv* create_vm(JavaVM ** jvm) {
    
    JNIEnv *env;
    JavaVMInitArgs vm_args;

    JavaVMOption options; 
    //Path to the java source code     
    options.optionString = "-Djava.class.path=G:\\Workspace"; 
    vm_args.version = JNI_VERSION_1_6; //JDK version. This indicates version 1.6
    vm_args.nOptions = 1;
    vm_args.options = &options;
    vm_args.ignoreUnrecognized = 0;
    
    int ret = JNI_CreateJavaVM(jvm, (void**)&env, &vm_args);
    if(ret < 0)
        printf("\nUnable to Launch JVM\n");       
    return env;
}





请帮我解决这个问题。



提前谢谢。



Please help me out what to do at this point.

Thanks in advance.

推荐答案

也许明显需要说明。您似乎需要包含一个包含_JNI_CreateJavaVM()定义的头文件。这看起来像java本机接口。如果你正在编译和链接到库,你需要告诉编译器/链接器在哪里找到你要调用的东西。



细节是特定于平台的,IDE特定的和命令行。更多详细信息需要您进一步帮助。
Maybe the glaringly obvious needs to be stated. It seems you need to include a header file that contains a definition of _JNI_CreateJavaVM(). This looks like the java native interface. If you are compiling and linking to a library, you need to tell the compiler/linker where to find the things you are calling.

The details are platform specific, IDE specific and command line specific. More details required to help you further.


检查此处 [ ^ ]为JNI提供帮助。
Check here[^] for JNI help.


这篇关于C代码中未定义的符号'_JNI_CreateJavaVM'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆