7

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!!

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
iSara
  • 919
  • 3
  • 10
  • 24
  • are you running in simulator ? try it in real device – Prashant Tukadiya Sep 19 '18 at 05:19
  • your SDK is only support for device – Anbu.Karthik Sep 19 '18 at 05:28
  • kindly provide more information , like what happen when you run on device, this is your own dynamic framework or you using third party framework ? for dynamic framework you need to add build script to make unirversal framework build that will run both sim and device. – Muhammad Shauket Sep 19 '18 at 05:34
  • @ShauketSheikh: My existing project used -lstdc++ library. Now Xcode 10 not support that library. So I have remove this library instead of that I have added -lc++ library like able suggested in xcode 10. After that I am facing the above issue. – iSara Sep 19 '18 at 13:43
  • What is `MAFConsoleLogger`? Seems to be a private library. Well, it needs to be rebuilt again without stdc++, and added again to your project. Also, avoid duplicating your question: https://stackoverflow.com/questions/52371265/library-not-found-for-lstdc-6-in-xcode-10 – Larme Sep 19 '18 at 14:30
  • Have you find the solution to this I am also having the same issues with a unity project after exporting as iOS. – Ayush Malviya Mar 12 '19 at 12:35

3 Answers3

4

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"

DCDC
  • 486
  • 5
  • 9
4

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'.
Ely
  • 8,259
  • 1
  • 54
  • 67
0

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

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
  • this was the answer for me - my subproject was a framework, and I had the target set to just iOS instead of iOS + OSX – Declan Land Nov 15 '19 at 11:56