• 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
Re: Desperate for Xcode Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Desperate for Xcode Help
      • From: "William C. McCain" <email@hidden>
References: 
 >Desperate for Xcode Help (From: "William C. McCain" <email@hidden>)
 >Re: Desperate for Xcode Help (From: Eric Albert <email@hidden>)

  • Prev by Date: Re: Universal Binaries for an app built with different SDK versions
  • Next by Date: Re: Desperate for Xcode Help
  • Previous by thread: Re: Desperate for Xcode Help
  • Next by thread: Re: Desperate for Xcode Help
  • Index(es):
    • Date
    • Thread