Re: Desperate for Xcode Help
Re: Desperate for Xcode Help
- Subject: Re: Desperate for Xcode Help
- From: "William C. McCain" <email@hidden>
- Date: Sat, 14 Jan 2006 03:07:42 -0800
William C. McCain wrote:
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 ...
Eric,
More progress -- I added a "Frameworks & Libraries" section as a new
"Build Phase" under "Targets", and THEN added the three existing
frameworks that I needed (JavaVM, CoreFoundation, IOKit). After doing
that, I was able to eliminate the "-framework JavaVM -framework
CoreFoundation -framework IOKit" string from the "Other Linker Flags",
because now those three -framework flags are automatically generated in
the linker options. This must be the "simpler way" that I was looking
for ... or at least the "non-brute-force" way!
I also tried following your suggestion and building (an alternate
version of) the project from the "Java JNI Application" template. In
fact, that was how I discovered the possibility of having a "Build
Phase" for "Frameworks & Libraries".
However, I was not able to get the "Java JNI Application" version of the
project to actually build successfully. No matter what I tried, Xcode
insisted on invoking g++ rather than gcc. The compile fails, because my
library is written in C, not C++. And I *DID* use the "Info" dialog on
my sources (.c and .h) to force them to NOT be "cpp" types -- all to no
avail, Xcode still wants to invoke the wrong compiler. Any ideas here?
Bottom line, I'm pretty satisfied now with the Xcode project I have that
builds my jnilib (the one based on the "BSD Dynamic Library" template).
But it sure was a struggle getting here! Maybe it's all in "what you
are used to", but I can't see how anybody could possibly think that an
IDE such as Xcode is easier to use than the two simple compile & link
commands that I have been using ...
Well, the unarguable fact is that my command-line method *IS* simpler --
but I'm willing to concede that this is largely due to the fact that my
"project" was so simple to begin with (one .c file and one .h file).
There are probably two curves here that "cross over": for really complex
projects, with hundreds of source files and other resources, the IDE
approach COULD very possibly have some advantages. If one can get past
the "learning curve", that is. I still claim that it's easier to learn
a compiler & linker & a well-documented set of command-line flags!
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