Re: Desperate for Xcode Help
Re: Desperate for Xcode Help
- Subject: Re: Desperate for Xcode Help
- From: "William C. McCain" <email@hidden>
- Date: Fri, 13 Jan 2006 22:42:18 -0800
Eric Albert wrote:
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.
Thanks, Eric, for the excellent suggestion. You have also been very
helpful in the past.
(I had already added /System/Library/Frameworks/JavaVM.framework/Headers
to the "Header Search Paths" for the target. That was necessary to
get a good compile. My issue was with the linker.)
As it happens, I was able to "fix up" the project that I already
started, fumbling around on my own. One thing that REALLY helped was
looking at the "build log" and seeing exactly what linker options were
being generated. What I found out, was that the "Framework Search Path"
in the "Build Options" actually generated -F flags rather than
-framework flags. (And the -F flags were unnecessary, since the linker
defaults to searching the standard paths such as
/System/Library/Frameworks.)
I tried (independently of your suggestion above) using "Add to Project"
to add the existing frameworks. However, the JavaVM, CoreFoundation,
and IOKit frameworks always got added to the "Groups & Files" list, but
they never showed up as "-framework" flags in the linker step. (I'm not
sure just WHAT role such frameworks play in the "Groups & Files" list.
Perhaps they needed to be placed differently, under "Source" or
"Products". Perhaps they don't do anything in Xcode 1.5, but will work
when I "move on" to Xcode 2.2.)
What finally "did the job" for me was simply adding the string
"-framework JavaVM -framework CoreFoundation -framework IOKit" to the
"Other Linker Flags" section of "Build Options"! If there's a simpler
way to get the same result, please let me know ...
Bill
_______________________________________________
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