Error: "clang: error: linker command failed with exit code 1" when running code on a new machine

1.7k views Asked by At

I have a project that compiles and runs successfully on my development machine. However, when I try to run it on a new machine

flutter run -d linux

I encounter the following error:

clang: error: linker command failed with exit code 1

when I create a new project on the new machine (flutter create test_project), it builds and runs without any issues. Then i move my code in lib to test_project (and also added pubspec, manifest ...). Again the above error comes up wit saying "build process failed"

Here are some details about the environment:

Original Machine: ubuntu 23 (latest)

New Machine: ubuntu 22.04

1

There are 1 answers

0
Darius On

Had the same problem as you, solved it doing the following:

  • ran the app using flutter run -v (this shows exactly the missing library or the exact error clang is detecting when running)
  • install the missing lib (in my case, it was lmediainfo, i searched on google for libmediainfo-dev and installed
  • rerun and everything worked just fine!