Re: Problems updating a dependent library
Re: Problems updating a dependent library
- Subject: Re: Problems updating a dependent library
- From: Chris Espinosa <email@hidden>
- Date: Fri, 22 Feb 2008 16:15:26 -0700
On Feb 22, 2008, at 3:44 PM, Rick Mann <email@hidden> wrote:
I have a project that uses Nano, a Carbon application framework. I
used the template it came with to start my application project. One
of the elements is a Dependency on the Nano xcode project. If you
turn that open, you can see the libNano.a file under that.
I got a new version of Nano, and put it next to my old version. I
removed the Nano project dependency and added the new Nano project
to my project. I ran into issues. For example, I had to change my
include search paths so that my code could find the Nano headers. I
also had some issues with the SDK (the old Nano required 10.4, and
couldn't build against 10.5; the new Nano builds against 10.5). I
guess that's fine.
I also got link issues that made it look like it wasn't linking
against libNano.a. After investigating, I saw that the target's
"Link Binary with Libraries" stage did not include libNano.a.
So I went back to the Nano.xcodeproj (the entry in my project),
dinked it open, and got info on libNano.a, hoping to add it to the
target. However, it only gave me Comments in the info box. So then I
tried to get info on Nano.xcodeproj, and there there is a Targets
panel, but I cannot click on the checkbox to add it to my target. Why?
Finally I just dragged libNano.a to the "Link..." build phase, and
that took care of most of the link issues.
But I still have link issues, like:
ld: warning
std:
:tr1::__stripped_tuple_type<std::tr1::reference_wrapper<TimerMsg>,
std::tr1::_NullClass, std::tr1::_NullClass, std::tr1::_NullClass,
std::tr1::_NullClass, std::tr1::_NullClass, std::tr1::_NullClass,
std::tr1::_NullClass, std::tr1::_NullClass,
std::tr1::_NullClass>::__type
std::tr1::make_tuple<std::tr1::reference_wrapper<TimerMsg> >
(std::tr1::reference_wrapper<TimerMsg>)has different visibility (2)
in /Developer/Nano/NanoSVN/Library/Project/build/Debug/libNano.a
(NApplication.o) and (1) in /Users/rmann/LZRepo/SatTrackX/branches/
CarbonNanoVersion/xcode/build/SatTrackX.build/Debug/SatTrackX.build/
Objects-normal/i386/DesktopChartWindowController.o
ld: warning std::tr1::tuple<TimerMsg&, std::tr1::_NullClass,
std::tr1::_NullClass, std::tr1::_NullClass, std::tr1::_NullClass,
std::tr1::_NullClass, std::tr1::_NullClass, std::tr1::_NullClass,
std::tr1::_NullClass, std::tr1::_NullClass> std::tr1::tie<TimerMsg>
(TimerMsg&)has different visibility (2) in /Developer/Nano/NanoSVN/
Library/Project/build/Debug/libNano.a(NApplication.o) and (1) in /
Users/rmann/LZRepo/SatTrackX/branches/CarbonNanoVersion/xcode/build/
SatTrackX.build/Debug/SatTrackX.build/Objects-normal/i386/
DesktopChartWindowController.o
and like:
"non-virtual thunk to NApplication::DoAppleEventReopenApp
(NAppleEvent const&)", referenced from:
vtable for CApplicationin CApplication.o
It seems like my code is compiling with the old set of headers
still, but linking against code built with new headers.
a) How can I find all the places where headers might be used
incorrectly? Just looking at the compile commands and parsing
through the options? Where are all the places search paths can be
set (I've looked and can't find any incorrect).
b) How am I supposed to add a project dependency, where that
project's build result is a statically-linked library I want linked
to my project?
In three separate and semantically distinct steps.
1) Add the project reference. This simply allows you access to the
other project's targets and build products. It does not create
dependencies or cause linking.
2) Add one of the second project's build products to a target in your
project. This will cause your target to be linked against it, and if
it's a framework, compiled against its headers. (If it's not a
framework, you have to set your Header Search Paths to find its
headers; that's one of the things frameworks are for.)
3) Add the target that builds that build product to your target's
dependencies. This causes that build product to be built if needed
when your target is built.
If you ask why Xcode doesn't do all that for you, it should, but there
are valid reasons to do only one or two of the three and not the
others, so it's not possible to make it fully automatic /and/ do what
you want all the time.
Chris
_______________________________________________
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