dcsimg
compile a shared object
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Roy_G
Posted On:   Wednesday, July 17, 2002 07:56 AM

I need help !! I'm trying to complie my native code (c++) on mandrake linux 8.0 using gcc 2.96 and I get some weird results. The first problem is that some STL methods (like Set::find() ) are not working well (find() doesn't find an object in the set). The second problem is that I get segmentation fault when I call to a certain method ( obj->foo() ) but everything works great with another method (obj->foo2() ). When I compliled the native code without the java and jni layers, all these problems disappear. This leads me to think that I'm not compiling the native code correctely: The compliation command I use is: g++ -I/usr/java/jdk1.3.1_04/include/ -I/usr/java/jdk1.3.1_04/include/linux/ -shared -o libXXX.so    More>>

I need help !!

I'm trying to complie my native code (c++) on mandrake linux 8.0 using gcc 2.96
and I get some weird results. The first problem is that some STL methods (like Set::find() ) are not working well (find() doesn't find an object in the set). The second problem is that I get segmentation fault when I call to a certain method ( obj->foo() ) but everything works great with another method
(obj->foo2() ).
When I compliled the native code without the java and jni layers, all these problems disappear. This leads me to think that I'm not compiling the native code correctely:
The compliation command I use is:
g++ -I/usr/java/jdk1.3.1_04/include/ -I/usr/java/jdk1.3.1_04/include/linux/ -shared -o libXXX.so f1.cpp f2.cpp ....

What am I doing wrong ???
The project (java + c++ ) works well on windows

Thank you,
Roy

   <<Less
About | Sitemap | Contact