iSara
iSara

Reputation: 929

symbol(s) not found for architecture x86_64 in xcode 10

I have facing the problem in my ios project. symbols not found for architecture x86_64 in xcode clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

Thanks in advance!!

Upvotes: 8

Views: 25157

Answers (3)

yoAlex5
yoAlex5

Reputation: 34175

ld: symbol(s) not found for

It is compile time error that is cased by Static Linker

ld: symbol(s) not found for ...
...
Undefined symbols for 

You should add a library or framework to General -> Linked Frameworks and Libraries section

enter image description here

Upvotes: 0

Ely
Ely

Reputation: 9121

In most cases this points to one or more missing references to frameworks in the section Linked Frameworks And Libraries in the Targets settings of the app in Xcode.

To find out which framework reference should be added:

  • Right-click on the error in the build time errors list
  • Choose 'Reveal in Log',
  • Search in the log for 'Undefined symbols for architecture x86_64'
  • A list of undefined 'symbols' (mostly class methods and properties) is displayed
  • To find out which framework reference should be added, select such undefined symbol, right-click and choose Search with Google
  • In most cases you'll end up in the documentation of Apple, which should give a clue about the related framework
  • Add the framework in the section Linked Frameworks And Libraries by clicking on the + button.
  • Build the app.
  • If necessary, repeat this procedure for remaining undefined 'symbols'.

Upvotes: 6

DCDC
DCDC

Reputation: 516

I had the exact same problem when running the unit tests for an application that had a custom framework as a dependency. The application was running fine but not its unit tests (I was getting the exact error shown above). I resolved it as follows: - Select the unit test target for the application (e.g. Tests) - Under "Testing" section enable "Allow testing Host Application APIs"

Upvotes: 4

Related Questions