Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: UnsatisfiedLinkError after building a JNI Library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UnsatisfiedLinkError after building a JNI Library



Miguel Muñoz wrote:

Do you know who to contact about getting the man files updated?

Good question. I'm not sure.

Step 1 is probably here, at the online man page:

http://developer.apple.com/documentation/Darwin/Reference/ManPages/ man1/gcc.1.html

It has a feedback form at the bottom, so please suggest correcting the error that x86_64 isn't listed as a valid arch. It's also odd that "x86-64" has some specific options for it, but isn't a listed arch.

Step 2 is probably to file a bug-report here:
  http://developer.apple.com/bugreporter


It might also make sense to revise gcc to produce x86_64 code by default on 64 bit machines.
That's more complicated.

You should read 'man arch' first. It explains the selection order in which arch'es are looked for.

Next, note that the 'gcc' command itself is only ppc/i386 2-way universal on Leopard. You can see it with this command-line:

  file `which gcc`

I mention this because of how gcc chooses a default target arch according to which executable runs from the universal binary. For example, use 'arch -ppc gcc' with no '-arch' option to gcc, and see what arch the .o is compiled for.

Finally, a lot of Mac OS X developers use Xcode, which has defaults for 4-way universal arch on release builds, but only native-arch on debug builds. And devlopers who use makefiles or other build tools usually do so with specific arch'es in mind. So in a practical sense, it doesn't matter as much what the minimally adorned command- line does, because it's not used often enough to make a convincing case to change its default behavior. If you want to argue otherwise, you should do so in your bug-report.

By the way, this would have been a lot shorter message thread if you'd initially said you were using a 64-bit JVM. I'm partly at fault for not requesting that detail in my first reply. I was misled by the inconsistent lib name and the fact my machine defaults to 32- bit Java. Nevertheless, these may be worthwhile for future reference:

  http://www.mikeash.com/getting_answers.html

  http://www.cocoadev.com/index.pl?HowToAskQuestions

  -- GG

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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.