lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Imre András <>
Subject Re: Unresolved external symbol errors when linking example native c++ code that uses jcc
Date Wed, 27 Oct 2010 15:20:55 GMT
Linking the dll project has the exact same result: unresolved external symbol "class JCCEnv
* env" messages.

It would be nice to have a working C++ only example in the distribution.


"Imre András" <> írta:
Andi Vajda <> í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.>
Cheers !>>
[2] JObject.cpp, JCCEnv.cpp, JCCEnv.h>>

View raw message