OpenAI
OpenAI copied to clipboard
Undefined symbol: nominal type descriptor for OpenAI.Completion
- Download OpenAI package.
- On the Project level, add OpenAI package into my project through Package Dependencies. OpenAI-main package shows up in the folder Packages; Alamofire 5.4.4 and AnyCodable 0.4.1 show up in Package Dependencies.
- On the Target level, add OpenAI product into Build Phases->Dependencies
- in my project, code "import OpenAI" in ContentView.swift without errors.
- run the build, the errors show:
Undefined symbols for architecture arm64: "nominal type descriptor for OpenAI.Completion.Choice", referenced from: _symbolic Say_____G 6OpenAI10CompletionV6ChoiceV in ContentView.o "nominal type descriptor for OpenAI.Completion", referenced from: _symbolic Say_____G 6OpenAI10CompletionV in ContentView.o "type metadata accessor for OpenAI.Client", referenced from: one-time initialization function for client in ContentView.o ForTest.ContentView.followUpPrompt(prompt: Swift.String) -> () in ContentView.o "OpenAI.Client.completions(engine: OpenAI.Engine.ID, prompt: Swift.String?, sampling: OpenAI.Sampling?, numberOfTokens: Swift.PartialRangeThrough<Swift.Int>?, numberOfCompletions: Swift.Int?, echo: Swift.Bool?, stop: [Swift.String]?, user: Swift.String?, presencePenalty: Swift.Double?, frequencyPenalty: Swift.Double?, bestOf: Swift.Int?, completion: (Swift.Result<[OpenAI.Completion], Swift.Error>) -> ()) -> ()", referenced from: ForTest.ContentView.followUpPrompt(prompt: Swift.String) -> () in ContentView.o "OpenAI.Client.__allocating_init(apiKey: Swift.String, organization: Swift.String?) -> OpenAI.Client", referenced from: one-time initialization function for client in ContentView.o ForTest.ContentView.followUpPrompt(prompt: Swift.String) -> () in ContentView.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbol: nominal type descriptor for OpenAI.Completion.Choice
Undefined symbol: nominal type descriptor for OpenAI.Completion
Undefined symbol: type metadata accessor for OpenAI.Client
Undefined symbol: OpenAI.Client.completions(engine: OpenAI.Engine.ID, prompt: Swift.String?, sampling: OpenAI.Sampling?, numberOfTokens: Swift.PartialRangeThrough<Swift.Int>?, numberOfCompletions: Swift.Int?, echo: Swift.Bool?, stop: [Swift.String]?, user: Swift.String?, presencePenalty: Swift.Double?, frequencyPenalty: Swift.Double?, bestOf: Swift.Int?, completion: (Swift.Result<[OpenAI.Completion], Swift.Error>) -> ()) -> ()
Undefined symbol: OpenAI.Client.__allocating_init(apiKey: Swift.String, organization: Swift.String?) -> OpenAI.Client