This project and target are supposed to produce a Java JNI dynamic library, and that's what it did before upgrading. Upon investigation I find that the Xcode "Upgrade to Native Target" set the Target Type to Static Library, and that is what is being linked. Setting the Mach-O Type to Dynamic Library doesn't seem to be enough to override whatever else is specifying static. The file command shows: libOUSB.jnilib: Mach-O universal binary with 2 architectures libOUSB.jnilib (for architecture ppc): current ar archive libOUSB.jnilib (for architecture i386): current ar archive
Setting up the name=OUSB, prefix=lib and extension=jnilib cured the initial '.a' extension problem, but that is obviously just the trimmings.
I went back and built the target within the project from before executing the "Upgrade All Targets in Project to Native" command - that target builds and the JNI lib works with my Java app on the Intel machine. It's only the Upgraded project that fails. Does anyone have any idea what setting(s) created by the Upgrade are overriding the Mach-O Type Build setting?
/Don
On Mar 9, 2006, at 11:56 AM, Daniel Jalkut wrote: Don - can you examine the resulting binary to see if it is in fact a static or a dynamic library? The "flie" command from the command line should let you see this. When you removed the "a" from executable extension, did you delete the build setting? (is it still bold?) If not, select the (now blank) setting and hit the delete key. You should see it turn from bold to plain. It sounds like you have inadvertently instructed Xcode to add an extension "" to your resulting binary. You may want to define this extension as "jnilib" since it's going to end up being that eventually anyway. Daniel On Mar 8, 2006, at 1:47 PM, Don Clark wrote:
I have a Java Native Interface (JNI) dylib project that built with Xcode 2.2 before being converted using the "Upgrade All Targets in Project to Native". Now the project builds a static library with .a extension. In the Project Settings the Mach-O type is specified as Dynamic Library, and now I have removed the "a" from the Executable Extension field, but the library is now named with a trailing "." (that would precede the "a" if it was still there). It appears that some option isn't set correctly, to produce a dylib with the specified name - note that Java loads JNI dylibs with the expectation that the name is libLibrary-Name-Here.jnilib Does anyone have any idea of why the dylib project now builds what appears to be a static library?
|