Questions tagged [clang]

Clang is a C/C++ language compiler frontend for LLVM.

Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages. It uses LLVM as its back end and has been part of its releases since LLVM 2.6.

The goal of the project is to offer a replacement to the GNU Compiler Collection (GCC).

115 questions
49
votes
4 answers

How to install clang++?

I'm having trouble getting clang++ to work as I compile my code. Specifically, I'm getting a make: clang++: Command not found error. I've run sudo apt-get install llvm, and also sudo apt-get install build-essential and sudo apt-get update. What do I…
user313944
  • 1,591
  • 2
  • 11
  • 8
35
votes
4 answers

How to install gcc-7 or clang 4.0?

I want to try C++17 features and I want to install standard compliant compiler (preferably GCC). I'm totally new to Linux and Ubuntu and I simply don't understand a lot. I tried to follow…
nikitablack
  • 545
  • 2
  • 5
  • 8
35
votes
8 answers

clang and clang++ not found after installing the clang-3.5 package

After installing the clang-3.5 package, typing clang or clang++ on the command line gives me a message stating which packages those programs can be found in. Attempting to run the install of clang-3.5 again, apt states it's already installed and at…
Dr. Spatula
  • 451
  • 1
  • 4
  • 5
32
votes
3 answers

How to install LLVM 3.9

I'm working with Emscripten and one of the error messages is: LLVM version appears incorrect (seeing "3.3", expected "3.9") But I can't find 3.9 on the LLVM page: http://llvm.org/releases/download.html#3.8.0 What can I do to install LLVM 3.9?
Bob van Luijt
  • 423
  • 1
  • 4
  • 7
25
votes
6 answers

Installing clang 6.0 on Ubuntu 18.04 LTS Bionic

How can I install clang on Ubuntu 18.04 LTS Bionic?
Bluetake
  • 279
  • 1
  • 3
  • 3
17
votes
1 answer

Installing clang 5.0 and using C++17

I have been trying for 3 days to install clang 5.0 on an Ubuntu 16.04 machine. I have tried various guides, but nothing seems to work. When I try to simply grab the latest from SVN and build/install (as detailed here), trying to compile a simple…
Steve D
  • 267
  • 1
  • 4
  • 13
17
votes
3 answers

Set clang-3.8 as default

I have installed clang 3.0 and clang 3.8: $ sudo update-alternatives --config clang update-alternatives: error: no alternatives for clang. How can I set 3.8 as /usr/bin/clang?
Andrew
  • 649
  • 1
  • 5
  • 11
17
votes
1 answer

llvm and clang installation on ubuntu

So I'm trying to install Halide on my Ubuntu 12.04 (64bit). I need llvm-3.2 and clang to be installed. Running sudo apt-get install llvm-3.2 ends up with 'package not found'. Trying sudo apt-get install llvm or sudo apt-get install clang installs…
Andrei Ivanov
  • 311
  • 1
  • 3
  • 4
17
votes
1 answer

How do I backport/install a newer version of clang?

I just want to install the newest version of clang http://packages.ubuntu.com/raring/clang-3.2 Does this mean I have to update my kernel to raring?
Maik Klein
  • 1,321
  • 5
  • 18
  • 27
17
votes
2 answers

How to set Clang 9 as the default C++ compiler on Ubuntu 19.10?

how do I set Clang 9 as the default C++ compiler on Ubuntu 19.10? I searched the internet, but nothing helped. Thank you for answer :)
user1027802
15
votes
1 answer

Installing clang 3.8 on Ubuntu 14.04.3

I've tried the following obvious commands: sudo apt-get update sudo apt-get install clang-3.8 but I get the message: Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to…
A Frayed Knot
  • 253
  • 1
  • 2
  • 5
13
votes
1 answer

How can Clang static analyzer (scan-build) be installed on Ubuntu 18.04?

In Ubuntu 16.04, I could: $ sudo apt install clang $ scan-build --help USAGE: scan-build [options] [build options] ... But in Ubuntu 18.04, after installing clang, the scan-build executable is not installed. How can I use apt to…
phoenix
  • 239
  • 1
  • 2
  • 7
12
votes
2 answers

How to compiler OpenMP program using clang?

My gcc compiles well, but clang fails with the following message: clang -fopenmp=libomp -o main main.c main.c:5:10: fatal error: 'omp.h' file not found I also installed libomp5 package and changed flag to -fopenmp=libomp5 , though it didn't help…
Bulat M.
  • 841
  • 4
  • 14
  • 32
11
votes
2 answers

clang++ cannot find iostream

Here is a simple code : #include #include #include #include #include #include #include int main() { std::cout << "Hello, world!" << std::endl; return 0; } when I…
Thomas
  • 401
  • 2
  • 11
10
votes
1 answer

clang doesn't find c++ stdlib on my ubuntu 18.04, but it does on a brand new install. What have I broken?

I've been building a github package for a while ... a new version comes out, and I build it. It uses clang6 which is default on my ubuntu, ubuntu 18.04 now, it fails to compile, it can't find a standard include. On a stock, brand new ubuntu 18.04 it…
Tim Richardson
  • 2,164
  • 2
  • 24
  • 42
1
2 3 4 5 6 7 8