Andi Vajda <va...@apache.org> írta: > Using JCC in your project is a two-step process. First get JCC to generate > the C++ wraper code for the Java code you want access to. This is, > hopefully, well documented on the JCC site [1]. Then take that generated > code tree and the necessary JCC runtime source files [2] and add them to > your project's build. Any file that includes <Python.h> unconditionally is > not part of the code you should include.>
This step is ok. > The last problem you found has to do with the fact that the env global > variable is declared in a file only needed by the Python runtime; jcc.cpp > should not be included in your project and you need to declare that global > in code of yours instead.> > In addition to files mentioned under [2], it seems that JArray.h is also needed. As I see JCCEnv.h dllexports JCCEnv *env (_jcc_shared is not defined). The link target for my code is an exe, and I keep getting unresolved external symbol errors for "class JCCEnv * env". At first I tried to hack around, and modify the *env ptr definition (strip the dll export), but that resulted in "already defined" errors. I guess the last chance is to create a separate project for jcc runtime and its generated code with a dll target. Then I would use that with dllimport in the code that uses that layer. Regards, András ... Cheers !> > Andi..> > [1] http://lucene.apache.org/pylucene/jcc/documentation/readme.html> [2] JObject.cpp, JCCEnv.cpp, JCCEnv.h> [3] http://java.sun.com/docs/books/jni/html/invoke.html