From: William S F. <ws...@fu...> - 2010-06-21 18:46:46
|
GoG wrote: > Hi everybody, > I found a problem trying to wrap my C++ code to Java. > I use 'director' feature on some of my classes and SWIG > generate thoses lines : > > > #if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) > // Attach a daemon thread to the JVM. Useful when the JVM should not > wait for > // the thread to exit upon shutdown. Only for jdk-1.4 and later. > director_->swig_jvm_->AttachCurrentThreadAsDaemon((void **)&jenv_, > NULL); > #else > director_->swig_jvm_->AttachCurrentThread((void **)&jenv_, NULL); > #endif > > > Or 'AttachCurrentThread[AsDaemon]()' is waiting for 'JENV**' as first > parameter. > So '(void **)' cast is useless plus make my GCC 4.4/MinGW fail building it > (on Windows/Linux). > > It's the only issue I have, preventing me from using continuous integration > on my project. > > Did I miss something in interface files or is it a SWIG issue ? > Thanks for your help. I don't recognise your error messages, but if the compiler cannot find AttachCurrentThread or AttachCurrentThreadAsDaemon, then you probably have a non-standard or maybe an extremely old JVM. Check your JVM docs for the existence of these methods. I presume you have tried with and without SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON being defined in your C++ layer? William |