• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
compiling JNI library for PPC and Intel hardware?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compiling JNI library for PPC and Intel hardware?


  • Subject: compiling JNI library for PPC and Intel hardware?
  • From: Rob Ross <email@hidden>
  • Date: Tue, 7 Nov 2006 10:53:50 -0800

I've read technote 1295 (http://developer.apple.com/qa/qa2005/ qa1295.html) and http://developer.apple.com/java/jniuniversal.html (building a JNI Universal application), but I'm still having trouble creating a jni library that works on both PPC and Intel hardware.

I don't actually have an intel machine, so that makes debugging more difficult for me. But I have created a jni library in the JDIC project which implements the TrayIcon API for Mac OS, and it works great on my G4 machine.

However, it gives an UnsatisfiedLinkError when run on an Intel box.

My jni library is composed of 6 source files, and I am compiling them via a shell script that is invoked via an ant task. The contents of the shell script are simply:

gcc -std=gnu99 -c -arch i386 -arch ppc -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -I/System/Library/Frameworks/JavaVM.framework/Headers -I/System/Library/Frameworks/Cocoa.framework/Headers *.m

gcc -dynamiclib -o ../libtray.jnilib *.o -framework JavaVM - framework Cocoa


Am I missing something?

Thanks,


Rob Ross, Lead Software Engineer
E! Networks
---------------------------------------------------
"Beware of he who would deny you access to information, for in his heart he dreams himself your master." -- Commissioner Pravin Lal




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: compiling JNI library for PPC and Intel hardware?
      • From: Dmitry Markman <email@hidden>
  • Prev by Date: Re: Polished metal.. and tabview!
  • Next by Date: Mixing Objective-C and C++
  • Previous by thread: Re: Polished metal.. and tabview!
  • Next by thread: Re: compiling JNI library for PPC and Intel hardware?
  • Index(es):
    • Date
    • Thread