This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

help!!


Hello, I would like to make you a question:

I'm trying to call to java code from C++ code, so I
have just do it for linux with gcc using gcj and gcjh.
Now, I have been trying the same for Windows 2000,
following these steps:

1.- Write the java file --> prueba_java.java
2.- Compile it with javac --> javac prueba_java.java
3.- Create the header file --> gcjh prueba_java
4.- Create the .o file --> 
          gcj gcj -c -g -O prueba_java.java 
5.- Write the C++ file, from which I call the java
code --> main.cc
6.- Compile it --> gcc -c -I /MinGW/include main.cc
7.- Linking with java code --> 
    gcc -static main.o prueba_java.o -o ejecutable -L
-L/MinGW/lib -lgcj -lmingw32 -lwsock32

   And when I try to execute the executable file (
ejecutable ), but it dies with an abnormal program
termination, because of the following error:

Program received signal SIGSEGV, Segmentation fault.
0x78002320 in _libwsock32_a_iname ()
(gdb) where
#0  0x78002320 in _libwsock32_a_iname ()
#1  0x0043f966 in
java::lang::System::init_properties() ()
#2  0x00413335 in
java::lang::System::getProperty(java::lang::String*)
()
#3  0x00458caa in
java::util::TimeZone::__U3c_clinit__U3e_() ()
#4  0x0040530f in java::lang::Class::initializeClass()
()
#5  0x004d671c in _Jv_InitClass () at {standard
input}:205
#6  0x004543f6 in
java::util::TimeZone::getTimeZone(java::lang::String*)
()
#7  0x00412f79 in
java::lang::System::getDefaultTimeZoneId() ()
#8  0x0043f7ed in
java::lang::System::init_properties() ()
#9  0x00413335 in
java::lang::System::getProperty(java::lang::String*)
()
#10 0x004602b1 in
java::io::PrintStream::__U3c_clinit__U3e_() ()
#11 0x0040530f in java::lang::Class::initializeClass()
()
#12 0x00402c31 in _Jv_AllocObjectNoFinalizer ()
#13 0x004136e7 in
java::lang::System::__U3c_clinit__U3e_() ()
#14 0x0040530f in java::lang::Class::initializeClass()
()
#15 0x004d671c in _Jv_InitClass () at {standard
input}:205
#16 0x004133e0 in
java::lang::System::getSecurityManager() ()
#17 0x0040c81a in java::lang::Thread::checkAccess() ()
#18 0x0040ca24 in java::lang::Thread::setDaemon(bool)
()
#19 0x004127a2 in
gnu::gcj::runtime::FinalizerThread::FinalizerThread()
()
#20 0x0040396f in _Jv_CreateJavaVM(void*) ()
#21 0x004d674d in JvCreateJavaVM(void*) () at
{standard input}:205
#22 0x004012b7 in main ()

I would like you to tell me how to solve this problem,
if it's possible..

Thank you very much for your attention..


___________________________________________________
Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...
http://messenger.yahoo.es

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]