Posted By:
Sven_Lukas
Posted On:
Wednesday, June 19, 2002 05:01 AM
Hi, I try to invoke Java methods from my c++ application running on Linux (i386). It works still fine, but now I want to clean up my c++ code and I found a bug. My new 'clean' c++ code starts by loading the libjvm.so like this: void *libjvm; libjvm = dlopen("/usr/java/j2sdk1.4.0/jre/lib/i386/client/libjvm.so", RTLD_NOW + RTLD_GLOBAL); if(!libjvm) throw int(-1); After this I'm loading a text file by std::ifstream in("foo.txt"); while(in.good()) { std::string filename; std::cout < < "debug: OK!" < < std::endl; in >> filename; std::cout < &l
More>>
Hi,
I try to invoke Java methods from my c++ application running on Linux (i386). It works still fine, but now I want to clean up my c++ code and I found a bug. My new 'clean' c++ code starts by loading the libjvm.so like this:
void *libjvm;
libjvm = dlopen("/usr/java/j2sdk1.4.0/jre/lib/i386/client/libjvm.so", RTLD_NOW + RTLD_GLOBAL);
if(!libjvm)
throw int(-1);
After this I'm loading a text file by
std::ifstream in("foo.txt");
while(in.good()) {
std::string filename;
std::cout
<
< "debug: OK!"
<
< std::endl;
in >> filename;
std::cout
<
< "debug: Hello computer? Someone at home?"
<
< std::endl;
// ...
}
My problem is now that the application hangs at the line "in >> filename;". If I remove the loading of the library it will work ! (?)
Does someone know where is the bug?
Thanks,
Sven
<<Less