Skip to content

Undefined symbols fails build #272

@FezVrasta

Description

@FezVrasta

Hi, I'm new to Swift and I'm trying to parse a XML file with XMLCoder. I installed the package using the built-in package manager of XCode and tried to use your package but at build time I get:

ld: Undefined symbols:
  XMLCoder.XMLDecoder.__allocating_init(trimValueWhitespaces: Swift.Bool, removeWhitespaceElements: Swift.Bool) -> XMLCoder.XMLDecoder, referenced from:
      Avalanche_ReportExtension.downloadReport() -> () in Avalanche_Report.o
  type metadata accessor for XMLCoder.XMLDecoder, referenced from:
      Avalanche_ReportExtension.downloadReport() -> () in Avalanche_Report.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm using the sample code provided by this repo:

let sourceXML = """
<note>
    <to>Bob</to>
    <from>Jane</from>
    <heading>Reminder</heading>
    <body>Don't forget to use XMLCoder!</body>
</note>
"""

struct Note: Codable {
    let to: String
    let from: String
    let heading: String
    let body: String
}

let note = try! XMLDecoder().decode(Note.self, from: Data(sourceXML.utf8))

let encodedXML = try! XMLEncoder().encode(note, withRootKey: "note")

Could someone please help me fix the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions