Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 958403

Pages: 1
moovida
Unregistered




macosx
      #1095 - 08/19/03 03:30 AM

Great deal,
my question is if someone has tried this on a Macosx system. I wasn't able to get the shared lib loaded using -dylib (the -shared of linux doesn't work any more).


Post Extras: Print Post   Remind Me!   Notify Moderator  
Anonymous
Unregistered




Re: macosx [Re: moovida]
      #22854 - 10/18/05 07:37 AM

here how I compiled it under MacOSX 10.3.9:
1) create the java class
javac -classpath . com/softtechdesign/math/MathLib.java
2) create the c header
javah -jni -o MathLib.h -classpath . com.softtechdesign.math.MathLib
3) compile the c library note that jni libraries have to be named lib<yourLibHere>.jnilib
cc -dynamiclib -std=gnu99 -I /Library/Java/home/include Math.c -current_version 1.0 -compatibility_version 1.0 -o libMathLib.jnilib
4) e voila now you can run the program
java -classpath . com.softtechdesign.math.MathLib

this worked for me.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 7359

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5