M1 _CFAbsoluteTimeGetCurrent Undefined symbols for architecture arm64:

CFAbsoluteTimeGetCurrent CFAbsoluteTimeGetDayOfWeek why system function Undefined symbols? is it relate to Deprecated? Function CFAbsoluteTimeGetDayOfWeek(::) Deprecated Returns an integer representing the day of the week indicated by the specified absolute time.

Apple M1 macOS 13.0 (22A380) Darwin 22.1.0

https://developer.apple.com/documentation/corefoundation/1543348-cfabsolutetimegetdayofweek

While CFAbsoluteTimeGetDayOfWeek has been deprecated, it’s still available, even on Apple silicon. Consider this:

  1. With Xcode 14.1, create a new project from the macOS > Command Line Tool target.

  2. Replace the code with that shown below.

  3. In the run destination popup, select Any Mac so that it builds both Apple silicon and Intel.

  4. Choose Product > Build.

It builds just fine.

I suspect that the problem here is that you’re not linking with the relevant framework, namely CoreFoundation.


Having said that, you really shouldn’t be using CFAbsoluteTimeGetDayOfWeek. It has been deprecated for a long time, and for good reason. This is not the path forward if you want to do calendrical calculations.

Share and Enjoy

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

import Foundation

func main() {
    print("Hello Cruel World!")
    let t: CFAbsoluteTime = 0
    CFAbsoluteTimeGetDayOfWeek(t, nil)
}

main()
M1 _CFAbsoluteTimeGetCurrent Undefined symbols for architecture arm64:
 
 
Q