Xcode 10 Error: linker command failed with exit code 1

Viewed 16203

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?

6 Answers

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.

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

go to your project directory in the terminal

Type:

pod deintegrate
pod install

In your project, open the Project Navigator, and expand the Frameworks folder. You will see the file -lstdc++.6 highlighted in red, delete it, rebuild your project and you're good to go.

You can open the RN..xcworkspace, and expand the Frameworks folder. You will see the file highlighted in red, delete it, Learn the build and rebuild the project, This problem will be resolved. goog cluck!

Related