• 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: Alexander von Below <email@hidden>
  • Date: Sat, 14 Jan 2006 01:14:36 +0100

As I have no clue about Java on JNI, I can not tell you what to do in Xcode. And while I work with Xcode daily, and like it a lot, Ggven your history you might be better off the terminal way... Also note, what I am saying comes from someone who has last seen Java in his thesis, many years ago.

But if I think "C":

- gcc 4.0 supports the -arch flag to compile binaries for ppc or i386. You can compile seperate binaries that way

- the lipo tool will allow you to combine the seperate binaries into one universal library.

I hope that these hints enable you to build universal binary JNI libraries in the terminal.

Alex

Am 14.01.2006 um 01:09 schrieb William C. McCain:

I am an experience software developer (more than 30 years as a software engineer for major companies in Silicon Valley). But I have never used an "IDE" -- I do all my development from the "Terminal" command line, as God intended :-).

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.)

But no matter what I try, the link always fails with the error:

Undefined symbols: _CFDictionarySetValue _CFRelease _CFStringCreateWithCString _CFStringGetCString _IOIteratorNext _IOMasterPort _IORegistryEntryCreateCFProperty _IOServiceGetMatchingServices _IOServiceMatching ___CFStringMakeConstantString _kCFAllocatorDefault

Clearly, it's not finding the system libraries that it needs to resolve these symbols. This probably involves the three frameworks specified in my command-line link: JavaVM, CoreFoundation, IOKit.

Xcode will not accept these framework names in the "Build Options" unless I expand them into full paths (e.g. /System/Library/ Frameworks/JavaVM.framework). But even so, I still get the "Undefined symbols" error message. I've tried putting these paths in the "Library Search Paths" build option and in the "Frameworks Paths" build option (and also in BOTH options). Nothing works. I am "tearing my hair out"!

Can somebody PLEASE tell me what I am doing wrong?

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

_______________________________________________ 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>)

  • Prev by Date: Desperate for Xcode Help
  • Next by Date: Re: Desperate for Xcode Help
  • Previous by thread: Desperate for Xcode Help
  • Next by thread: Re: Desperate for Xcode Help
  • Index(es):
    • Date
    • Thread