Re: Desperate for Xcode Help
Re: Desperate for Xcode Help
- Subject: Re: Desperate for Xcode Help
- From: Eric Albert <email@hidden>
- Date: Fri, 13 Jan 2006 16:24:30 -0800
On Jan 13, 2006, at 4:09 PM, William C. McCain wrote:
Now, however, as the sole proprietor of a one-person software
enterprise, I am faced with building a dynamic library (a Java JNI
library to be exact) with Xcode so that I can then build a
universal binary (for the new Intel-based Macs). So, to begin
with, I am trying to use Xcode to re-build my existing PPC-only
library (using Xcode 1.5 under Panther). Then I plan to use Xcode
2.2 under Tiger to build the universal version.
My "project" is EXTREMELY simple. It has two source files,
serial.c and serial.h. My command-line build consists of a compile:
cc -c -I/System/Library/Frameworks/JavaVM.framework/Headers serial.c
... followed by a link:
cc -dynamiclib -o libserial.jnilib serial.o -framework JavaVM -
framework CoreFoundation -framework IOKit
And that's all there is to it! It produces an object file,
serial.o, and a dynamic library, libserial.jnilib.
After a monumental struggle, I have managed to produce an Xcode
project that compiles the correct object file, serial.o. (I
started with a "BSD Dynamic Library" template, as that seemed
closest to what I was trying to do.)
Start with the "Java JNI Application" template. Delete all of the
targets other than the "JNILib" target. Add serial.c to your
project. Go to Project->Add to Project, navigate to /System/Library/
Frameworks, and select the JavaVM, CoreFoundation, and IOKit
frameworks. Add /System/Library/Frameworks/JavaVM.framework/Headers
to the Header Search Paths for the JNILib target. Then build and you
should have your JNI library.
Hope this helps,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden