Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use Swift on Ubuntu 18.04

After conscientiously following the install instructions on Linux from swift.org, I encounter an issue where it is not possible to compile anything on a Ubuntu 18.04 machine. The REPL seems to work but during compilation (when calling swift build) the following error appears:

/usr/bin/ld: cannot find -lstdc++

There are more details in the full bug report [SR-9093]. I don't know at all what to do to solve this issue, there are similar problems already mentioned in other bug reports, for instance on this really old one [SR-35].

What should I do?

Thank you

like image 471
Pop Flamingo Avatar asked Oct 26 '18 22:10

Pop Flamingo


2 Answers

I am assuming that you had already installed the libstdc++ successfully and you have set the permissions properly. But I really doubt that it was installed correctly but it was installed with corruption of some sort. The corruption occurred because you didn't install libstdc++ via a package manager. Result was some form of weirdness in the package manager database which effected the overall functioning system. Exactly why adding something to a folder should change anything at all. I don't know why this happens, unless the folder is hot i.e symbolically linked to a program which doesn't have any tolerance for hacks like simply copying a file into the folder. So for now try to install the libstdc++ again. Below is the link to the file to again download the correct program and this is compatible with amd64.

http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.10_amd64.deb

And below are some link to help

  1. https://ubuntuforums.org/showthread.php?t=1425470
  2. https://ubuntuforums.org/showthread.php?t=808045
  3. https://ubuntuforums.org/showthread.php?t=808045
  4. https://packages.ubuntu.com/search?keywords=libstdc%2B%2B
  5. https://packages.ubuntu.com/xenial/amd64/libstdc++6
like image 186
Varun Jain Avatar answered Oct 23 '22 05:10

Varun Jain


Install libstdc++

sudo apt install libstdc++6

like image 36
Muhammad Muntaza Avatar answered Oct 23 '22 07:10

Muhammad Muntaza