I am trying to follow a basic tutorial using AudioKit 4.1. I first imported the AudioKit framework in the project as shown in the image below.
After importing the AudioKit framework, I added a few lines of code in the ViewController as follows:
import UIKit
import AudioKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let oscillator = AKOscillator()
oscillator.amplitude = 0.1
AudioKit.output = oscillator
oscillator.start()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Upon running the code, I got 59 error as shown in the image below. How do you fix it?
Since version 4.1, AudioKit is now shipped as a static framework. Because of all the internal C++ code, it depends on the standard C++ library. This dependency used to be resolved automatically by the dynamic linker, but not any more.
The easiest way to make these errors go away is to simply add the -lstdc++
linker flag in your target settings in Xcode (under "Other Linker Flags").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With