2

I'm trying to integrate MetatoneOSC into a brand new Swift iOS project.

What I've done so far:

  • Create new iOS Swift Project
  • Drag folder full of .h and .m files into Xcode project
  • Create a functioning bridging header (autocomplete now works for methods in the library) - #import "MetatoneOSC/F53OSC.h"
  • Put the following code in ViewController.swift:

let client = F53OSCClient.init()

The build fails with the following error:

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_F53OSCClient", referenced from: type metadata accessor for __ObjC.F53OSCClient in ViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Each new class I use in my code creates a duplicate error, with a different class name after $_F53OSC in the error message.

I have tried setting up a new Objective-C project to make sure it's not a bridging error, and I get exactly the same error. Anyone know how I can resolve this?

1 Answer 1

2

This generally means you forgot to compile the relevant .m file. In you "Build Phases > Compile Sources" step for the target, make sure you've included all the relevant files. This doesn't always happen automatically if you just drag them into the project.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, it turns out that adding them using the file picker instead of dragging them added everything to the Compile Sources

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.