• 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
Linker woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linker woes


  • Subject: Linker woes
  • From: Tim Murison <email@hidden>
  • Date: Tue, 12 May 2009 16:41:43 -0400
  • Thread-topic: Linker woes

Hi,

I'm trying to resolve a problem I'm having with XCode during the link phase
of one of my libs. The circumstances are rather complicated, so I'll try to
explain as best as I can.

My project outputs all dylibs to a folder "build/Debug/Libraries". I have 2
xcode projects, main and common.

common creates a bunch of dylibs used in main.
main also creates a bunch of dylibs.

Here's the problem. Within main I have a dylib, "mylib", and some unit tests
for it, "myLibTests". "myLibTests" must link against "mylib". Furthermore,
"myLibTests" is output in "build/Debug/Tests". When compiling "myLibTests",
XCode generates a gcc command that uses the absolute path to "mylib.dylib".
The problem is the absolute path is wrong.

"mylib.dylib" exists in "build/Debug/Libraries" whereas "myLibTests" exists
in "build/Debug/Tests". The path XCode generates to "mylib.dylib" is
"build/Debug/Tests/mylib.dylib" instead of
"build/Debug/Libraries/mylib.dylib". To make matters worse, "myLibTests"
also links against libraries from the common project, these all have the
correct path.

I'm using a common xcconfig across both projects, so I know all the build
settings are the same for the libraries in main as the ones in common. I
have set CONFIGURATION_BUILD_DIR to "build/Debug/Libraries" in the xcconfig,
and it shows up correctly when inspecting the target properties for all my
dylibs.

Does anyone know what I'm doing wrong, or how to tell XCode to use relative
paths in the linker command so I can configure the correct behaviour myself?

Cheers,

-Tim

 _______________________________________________
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: Linker woes
      • From: Preston Jackson <email@hidden>
  • Prev by Date: Re: xcode code-indexing intermittent hangs
  • Next by Date: Re: iPhone 2.2 docs (14.8) still crash Xcode
  • Previous by thread: Re: iPhone 2.2 docs (14.8) still crash Xcode
  • Next by thread: Re: Linker woes
  • Index(es):
    • Date
    • Thread