I've decided to get myself into more trouble by attempting to build
JCC on Windows XP with MinGW (gcc 3.4.5, I believe).

I needed to patch the JCC sources a bit (I attach the patch below).

Now I'm running into trouble loading jcc in python, because it can't
find the JVM dll:

     from _jcc import initVM
 ImportError: DLL load failed: The specified module could not be found.

If I attempt to use jcc to compile Lucene, I get the pop-up box
saying, "This application has failed to start because jvm.dll was not
found.  Re-installing the application may fix this problem."

Any ideas on how to defeat this?

Bill

Index: jcc/jcc/sources/JCCEnv.cpp
===================================================================
--- jcc/jcc/sources/JCCEnv.cpp  (revision 405)
+++ jcc/jcc/sources/JCCEnv.cpp  (working copy)
@@ -35,13 +35,13 @@
 #include "macros.h"
 #endif
 
-#ifdef _MSC_VER
+#if (defined(_MSC_VER) || defined(__WIN32))
 DWORD JCCEnv::VM_ENV = 0;
 #else
 pthread_key_t JCCEnv::VM_ENV = (pthread_key_t) NULL;
 #endif
 
-#ifdef _MSC_VER
+#if (defined(_MSC_VER) || defined(__WIN32))
 
 static CRITICAL_SECTION *mutex = NULL;
 
@@ -73,7 +73,7 @@
 
 JCCEnv::JCCEnv(JavaVM *vm, JNIEnv *vm_env)
 {
-#ifdef _MSC_VER
+#if (defined(_MSC_VER) || defined(__WIN32))
     if (!mutex)
     {
         mutex = new CRITICAL_SECTION();
@@ -116,7 +116,7 @@
                             "()Ljava/lang/String;");
 }
 
-#ifdef _MSC_VER
+#if (defined(_MSC_VER) || defined(__WIN32))
 
 void JCCEnv::set_vm_env(JNIEnv *vm_env)
 {
Index: jcc/jcc/sources/functions.cpp
===================================================================
--- jcc/jcc/sources/functions.cpp       (revision 405)
+++ jcc/jcc/sources/functions.cpp       (working copy)
@@ -53,7 +53,7 @@
     Py_RETURN_NONE;
 }
 
-#if defined(_MSC_VER) || defined(__SUNPRO_CC)
+#if (defined(_MSC_VER) || defined(__WIN32) || defined(__SUNPRO_CC))
 int __parseArgs(PyObject *args, char *types, ...)
 {
     int count = ((PyTupleObject *)(args))->ob_size;
Index: jcc/jcc/sources/JCCEnv.h
===================================================================
--- jcc/jcc/sources/JCCEnv.h    (revision 405)
+++ jcc/jcc/sources/JCCEnv.h    (working copy)
@@ -25,7 +25,7 @@
 #define _JCCEnv_H
 
 #include <stdarg.h>
-#ifdef _MSC_VER
+#if (defined(_MSC_VER) || defined(__WIN32))
 #include <windows.h>
 #undef MAX_PRIORITY
 #undef MIN_PRIORITY
@@ -101,7 +101,7 @@
     explicit JCCEnv(JavaVM *vm, JNIEnv *env);
     virtual ~JCCEnv() {};
 
-#ifdef _MSC_VER
+#if (defined(_MSC_VER) || defined(__WIN32))
     static DWORD VM_ENV;
 
     inline JNIEnv *get_vm_env()
Index: jcc/jcc/sources/functions.h
===================================================================
--- jcc/jcc/sources/functions.h (revision 405)
+++ jcc/jcc/sources/functions.h (working copy)
@@ -70,7 +70,7 @@
 void throwPythonError(void);
 void throwTypeError(const char *name, PyObject *object);
 
-#if defined(_MSC_VER) || defined(__SUNPRO_CC)
+#if (defined(_MSC_VER) || defined(__WIN32) || defined(__SUNPRO_CC))
 
 #define parseArgs __parseArgs
 #define parseArg __parseArg
Index: jcc/setup.py
===================================================================
--- jcc/setup.py        (revision 405)
+++ jcc/setup.py        (working copy)
@@ -48,8 +48,8 @@
                '/usr/lib/jvm/java-6-sun/include/linux'],
     'sunos5': ['/usr/jdk/instances/jdk1.6.0/include',
                '/usr/jdk/instances/jdk1.6.0/include/solaris'],
-    'win32': ['o:/Java/jdk1.6.0_02/include',
-              'o:/Java/jdk1.6.0_02/include/win32'],
+    'win32': ['c:/Program Files/Java/jdk1.6.0_04/include',
+              'c:/Program Files/Java/jdk1.6.0_04/include/win32'],
 }
 
 CFLAGS = {
@@ -66,7 +66,7 @@
                
'-Wl,-rpath=/usr/lib/jvm/java-6-sun/jre/lib/i386:/usr/lib/jvm/java-6-sun/jre/lib/i386/client'],
     'sunos5': ['-L/usr/jdk/instances/jdk1.6.0/jre/lib/i386', '-ljava',
                
'-R/usr/jdk/instances/jdk1.6.0/jre/lib/i386:/usr/jdk/instances/jre/lib/i386/client'],
-    'win32': ['/LIBPATH:o:/Java/jdk1.6.0_02/lib', 'jvm.lib']
+    'win32': ['c:/Program Files/Java/jdk1.6.0_04/lib/jvm.lib']
 }
 
 #alternatives



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

Reply via email to