Los códigos son: Prueba251_uso_packageApp
Prueba251_uso_packageApp.swift
import SwiftUI
import PckNorma
@main
struct Prueba251_uso_packageApp: App {
var body: some Scene {
WindowGroup {
ContentView(n: Norma())
}
}
}
ContentView.swift ´´´ import SwiftUI import PckNorma
struct ContentView: View {
import SwiftUI
import PckNorma
struct ContentView: View {
var n: Norma = Norma()
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text(n.norma())
}
.padding(100)
}
}
} ´´´
ld: Undefined symbols: PckNorma.Norma.__allocating_init() -> PckNorma.Norma, referenced from: variable initialization expression of Prueba251_uso_package.ContentView.n : PckNorma.Norma in ContentView.o Prueba251_uso_package.ContentView.init() -> Prueba251_uso_package.ContentView in ContentView.o default argument 0 of Prueba251_uso_package.ContentView.init(n: PckNorma.Norma) -> Prueba251_uso_package.ContentView in ContentView.o closure #1 () -> Prueba251_uso_package.ContentView in Prueba251_uso_package.Prueba251_uso_packageApp.body.getter : some in Prueba251_uso_packageApp.o type metadata accessor for PckNorma.Norma, referenced from: variable initialization expression of Prueba251_uso_package.ContentView.n : PckNorma.Norma in ContentView.o Prueba251_uso_package.ContentView.init() -> Prueba251_uso_package.ContentView in ContentView.o default argument 0 of Prueba251_uso_package.ContentView.init(n: PckNorma.Norma) -> Prueba251_uso_package.ContentView in ContentView.o closure #1 () -> Prueba251_uso_package.ContentView in Prueba251_uso_package.Prueba251_uso_packageApp.body.getter : some in Prueba251_uso_packageApp.o nominal type descriptor for PckNorma.Norma, referenced from: _symbolic _____ 8PckNorma0B0C in ContentView.o clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: Undefined symbols:
PckNorma.Norma.__allocating_init() -> PckNorma.Norma, referenced from:
variable initialization expression of Prueba251_uso_package.ContentView.n : PckNorma.Norma in ContentView.o
Prueba251_uso_package.ContentView.init() -> Prueba251_uso_package.ContentView in ContentView.o
default argument 0 of Prueba251_uso_package.ContentView.init(n: PckNorma.Norma) -> Prueba251_uso_package.ContentView in ContentView.o
closure #1 () -> Prueba251_uso_package.ContentView in Prueba251_uso_package.Prueba251_uso_packageApp.body.getter : some in Prueba251_uso_packageApp.o
type metadata accessor for PckNorma.Norma, referenced from:
variable initialization expression of Prueba251_uso_package.ContentView.n : PckNorma.Norma in ContentView.o
Prueba251_uso_package.ContentView.init() -> Prueba251_uso_package.ContentView in ContentView.o
default argument 0 of Prueba251_uso_package.ContentView.init(n: PckNorma.Norma) -> Prueba251_uso_package.ContentView in ContentView.o
closure #1 () -> Prueba251_uso_package.ContentView in Prueba251_uso_package.Prueba251_uso_packageApp.body.getter : some in Prueba251_uso_packageApp.o
nominal type descriptor for PckNorma.Norma, referenced from:
_symbolic _____ 8PckNorma0B0C in ContentView.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)