How to get defined current library version in xcode "Build Setting - linking or versionning"

I want to make API return the defined version in static library.

How I get defined current library version on xcode "Build Setting - linking or versioning"?

like VERSION : Clang version.

some preprocessor macro? or static char was defined?

If anyone knows, please share.

NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]; is not working correctly in static library.

Your question doesn’t really make sense. Static library doesn’t have a version number.

Library version numbers crop up in two places:

  • For dynamic libraries, there’s a version embedded in the Mach-O as part of the LC_ID_DYLIB load command.

  • For frameworks, there’s a version in the Info.plist.

Neither of these are relevant to static libraries.

Can you post an example of a static library and the version number that you’re trying to extract from it?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to get defined current library version in xcode "Build Setting - linking or versionning"
 
 
Q