On Thu, 20 Mar 2008, Bill Janssen wrote:

Enabling 'shared' on Windows means that you figured out a way to make a
Library (as instantiated in setup.py) build there with setuptools. I didn't
verify that this was implemented on Windows. Maybe it works. It requires
setuptools 0.6c7 at least (for instance, on Linux, 0.6c6 produces a .a file
instead of a .so, so no good).

Yeah, it doesn't seem to work out-of-the-box.

This doesn't look like a setuptools problem.

The problem is that these undefined symbols are resolved at load time. On Mac this is done with -undefined dynamic_lookup and the symbols are found in the shared library (the jcc-built extension) loading libjcc.dylib.

This actually shows a bug with the current 'shared' setup. For instance, the reference to the java::lang::Class C++ class will come from the first lib loading libjcc.dylib. It looks like the ConstVariableDescriptorType needs to be moved out of the shared lib and into the code that gets statically linked into the jcc-built extension.

On the other hand, the FinalizerProxyType and JObjectType should probably
move into the shared jcc lib. The only thing that really must be shared is JCCEnv and it may be tricky to isolate it correctly unless all that's in the way is env->fromPySequence()

More on this later...

Andi..


c:\mingw\bin\g++.exe -mno-cygwin -shared -s 
build\temp.win32-2.4\Release\jcc\sources\jcc.o 
build\temp.win32-2.4\Release\jcc\sources\jccenv.o 
build\temp.win32-2.4\Release\jcc\sources\jcc.def -Lc:\Python24\libs -Lc:\Python24\PCBuild 
-lpython24 -lmsvcr71 -o build\lib.win32-2.4\jcc.dll "c:/Program 
Files/Java/jdk1.6.0_04/lib/jvm.lib"
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x428): undefined 
reference to `java::lang::Object::initializeClass()'
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x47e): undefined 
reference to `java::lang::Class::initializeClass()'
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x4db): undefined 
reference to `java::lang::t_Class::wrapObject(java::lang::Class const&)'
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x844): undefined 
reference to `PyErr_SetJavaError(_jthrowable*)'
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x8ff): undefined 
reference to `java::lang::Object::initializeClass()'
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x955): undefined 
reference to `java::lang::Class::initializeClass()'
build\temp.win32-2.4\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x9b8): undefined 
reference to `java::lang::t_Class::wrapObject(java::lang::Class const&)'
build\temp.win32-2.4\Release\jcc\sources\jccenv.o:JCCEnv.cpp:(.text+0x2b10): 
undefined reference to `PyErr_SetJavaError(_jthrowable*)'
build\temp.win32-2.4\Release\jcc\sources\jccenv.o:JCCEnv.cpp:(.text+0x2c08): 
undefined reference to `JObjectType'
build\temp.win32-2.4\Release\jcc\sources\jccenv.o:JCCEnv.cpp:(.text+0x2c12): 
undefined reference to `JObjectType'
build\temp.win32-2.4\Release\jcc\sources\jccenv.o:JCCEnv.cpp:(.text+0x2c42): 
undefined reference to `FinalizerProxyType'
build\temp.win32-2.4\Release\jcc\sources\jccenv.o:JCCEnv.cpp:(.text+0x2c4c): 
undefined reference to `FinalizerProxyType'
build\temp.win32-2.4\Release\jcc\sources\jccenv.o:JCCEnv.cpp:(.text+0x2d5b): 
undefined reference to `PyErr_SetJavaError(_jthrowable*)'
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1

_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to