Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 Error: linker command failed with exit code 1

I just updated my Xcode to Xcode 10 and now my project will not run and I get the error:

ld: library not found for -lstdc++.6 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I do not know what this means and how to fix it. I tried googling everywhere for the answer and came up with nothing. How can I fix this?

like image 260
ap123 Avatar asked Sep 17 '18 23:09

ap123


3 Answers

go to your project directory in the terminal

Type:

pod deintegrate
pod install
like image 81
user798719 Avatar answered Nov 08 '22 13:11

user798719


Open the projectname.xcworkspace if you are using cocoapods not the projectname.xcodeproj.

Alternatively, using terminal

$ open projectname.xcworkspace

enter image description here

Hope this helps.

like image 10
yveszenne Avatar answered Nov 14 '22 02:11

yveszenne


I had this problem today in C++ using a newly upgraded Xcode 10 in a project that does not use pods, unlike the other answers.

When I clicked on the linker error there were no details given. This stumped me for a while and then I realised you can right-click the linker error and click "reveal in log".

In my case it was just a function that I had renamed-but-not-updated-all-the-references-to-it causing a linker error, but the real problem was that the linker error details were not being shown when the error occurred.

enter image description here

like image 5
Matt Parkins Avatar answered Nov 14 '22 03:11

Matt Parkins