`swift test` produces "symbol(s) not found for architecture x86_64" linker error

1.1k views Asked by At

I'm currently trying to add support for the Swift Package Manager to a side-project I've been working on and am running into trouble when trying to run the unit tests I have for the project.

When running them within XCode, I have no problem building and running all of my unit tests; however, when I try to run my tests with the package manager using swift test, I get the following linker error:

ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
1

There are 1 answers

1
jakerockland On

I ended up figuring out a solution that I'm happy with. I've added a link to the PR here that fixed things, but the general solution was to create a new shared framework target that both my executable and test targets linked to!