10-14-2010, 04:00 PM #1
A simple example for calling an existing java code from c using jni?
- Member Since
- Oct 14, 2010
I have an existing java code and I want to use its function in c language. As I found till now I should use jni. I have read a sample in this link:
Java programming with JNI
If I want to compile the c code with the command below I have to change the code a little.Because of the last sentence that has mentioned in this link:
Re: JNI NIO early compilation error
I use these command to compile:
g++ -framework -I/System/Library/Frameworks/JavaVm.framů -c Sample2.c -o Sample2.o
I got this as result :
i686-apple-darwin10-g++-4.2.1: cannot specify -o with -c or -S with multiple files
and it doesn't work! and I don't know how should I compile and run it.:-(
and I even know what's wrong with that!
Can you please put any comment on this ? Or do you know another way to do what I'm going to do.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By xcodeFREAK in forum iOS DevelopmentReplies: 1Last Post: 06-03-2011, 12:46 PM
By arron in forum Web Design and HostingReplies: 7Last Post: 10-27-2009, 01:44 PM
By niroshpg in forum OS X - Operating SystemReplies: 2Last Post: 05-28-2009, 08:57 AM
By shoelessone in forum OS X - Operating SystemReplies: 0Last Post: 07-12-2007, 10:13 AM
By pitythefool in forum OS X - Apps and GamesReplies: 0Last Post: 02-22-2005, 11:07 AM