I have to compile some libraries that need gcc 4.8 but I am on wheezy. another option is clang.

these are several libraries that downloaded automatically and called from installer so I can not modifies config to use clang.

how can I change default compiler to clang in debian instead?

  • 1
    Build scripts usually determine the "default compiler" by using the environment variable CC. Try to set it to clang and everything might work fine. – michas Jan 18 '17 at 7:05

Use the following:

sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
|improve this answer|||||
  • 3
    Just a note for g++ users, you also want sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 – Brian Stamper Feb 21 '19 at 3:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.