• 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: Should I be building a static or dynamic library?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should I be building a static or dynamic library?


  • Subject: Re: Should I be building a static or dynamic library?
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 12 Aug 2012 14:05:36 -0700

On Aug 12, 2012, at 13:41 , Stephen Kay <email@hidden> wrote:

After importing into Xcode, the Projects Inspector > Build > Mach O Type is
set to "Static Library". Is this correct? (Seems wrong...because...)

According to what I've read, if it is a static library, it should have the
suffix ".a". So I set it to that, and it successfully creates libMyLibrary.a
(example).

In the parent project, I've included libMyLibrary.a, and in the inspector
for the library, set the File Type to "archive".

But in the Target's Build Phase "Link Binary With Libraries", when you try
to build this, it gives the error:

warning: skipping file 'foofoo/libMyLibrary.a' (unexpected file type
'archive' in Frameworks & Libraries build phase)

It seems to me you're doing something unnecessary/unwanted by changing the File Type manually. In general, you would only want to change it yourself if your file had the "wrong" extension. In this case, your library has the correct ".a" extension, so you should be able to let the File Type get set automatically.

I'd suggest you simply remove the library from the project's Groups & Files list, then add it back again and give it the correct target membership. If you want to use it as an ordinary library, that should be sufficient.

FWIW, though I don't have an Xcode 2.x project handy to look at, in Xcode 3.x the automatically-detected File Type shows as "archive.ar" for a simple libXXX.a library added to the project. The manual choice of "archive" may have been the only thing that was wrong.


 _______________________________________________
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: Should I be building a static or dynamic library?
      • From: Stephen Kay <email@hidden>
References: 
 >Should I be building a static or dynamic library? (From: Stephen Kay <email@hidden>)

  • Prev by Date: Should I be building a static or dynamic library?
  • Next by Date: Re: Link error '/usr/bin/g++-4.0 failed with exit code 1'
  • Previous by thread: Should I be building a static or dynamic library?
  • Next by thread: Re: Should I be building a static or dynamic library?
  • Index(es):
    • Date
    • Thread