Undefined symbols for architecture x86_64: JNI_CreateJavaVM OS-X Xcode

后端 未结 1 593
北海茫月
北海茫月 2021-01-19 01:20

I am attempting to compile the following C++ code for creating a Java Virtual Machine, using Xcode on Mac OS-X Mountain Lion:

JNIEnv * createVM(JavaVM **jvm)         


        
相关标签:
1条回答
  • 2021-01-19 01:42

    OK, found the solution,

    the equivalent of g++'s

    -L<library/to/link>
    

    setting in Xcode is the Link Binary with Libraries setting under the Build Phases tab, not the Library Search Paths list that I mentioned above.

    and the library I needed to link to was actually /System/Library/Frameworks/JavaVM.framework/JavaVM,

    not libjvm.dylib

    0 讨论(0)
提交回复
热议问题