Questions tagged [clang]

clang is a C, C++, Objective-C/C++ compiler compatible with GNU gcc extensions.

clang is a front-end to the LLVM compiler infrastructure that provides for the implementation of fast compilers with expressive diagnostics and exploitable source code under a BSD licence.

The compiler for C, C++, and Objective C/C++ that targets X86-32, X86-64, and ARM architectures is intended to be fast, low memory, and of bug-free production quality, readily integrated into any IDE.

48 questions
25
votes
4 answers

How to install clang-10 on Ubuntu 20.4

I upgraded my Linux box from Ubuntu 18.04 to 20.04. I need to install the clang suite of compilers and the apt command is giving me errors. I've searched many possible solutions but so far none of the recommendations I have found to solve similar…
Michel
  • 359
  • 1
  • 3
  • 4
8
votes
1 answer

how to install newest clang 3.8 by apt

here I have found instruction how to install clang3.8: http://llvm.org/apt/ so I executed: wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add - result: --2015-09-19 12:53:09-- http://llvm.org/apt/llvm-snapshot.gpg.key …
bataliero1234
  • 81
  • 1
  • 1
  • 3
7
votes
2 answers

clang-tidy install

I have clang installed from packages on both Ubuntu 14.07, Centos 7 and Fedoara 22. I would like to use clang-tidy but can neither find a package nor how to install it without installing clang from source. That's something I would rather not…
4
votes
1 answer

How to install clang 3.9 or higher using apt-get on Linux Mint?

I know that there are similar questions for installation of clang-lower versions. But, I am trying to follow them to install clang-3.9 or 4.0 , but I am unable to do so on my Linux Mint 18. First, I was only getting options upto clang-3.8 using…
tonystark
  • 43
  • 1
  • 4
4
votes
2 answers

clang is refusing to install through apt

So, I wanted to get Unreal Engine 4, but for some odd reason, clang does not want to install. I have never used clang at all before, and it isn't even installed, so I have no real clue what is happening. Registering git hooks... (this will override…
SpecialBomb
  • 1,928
  • 9
  • 24
  • 36
3
votes
0 answers

How to change clang-10, llvm-10, etc to clang, llvm, etc.?

I use Spacemacs, and installed llvm-10, clnag-10, clangd-10, and all related packages, in Debian 10. Used the following command to install llvm $ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" Then, changed clangd-10 to clangd using the…
tom_kp
  • 33
  • 1
  • 4
3
votes
1 answer

Missing c++ headers under alpine clang

I'm trying to build a small alpine-based docker container to build c++ app using clang++. Dockerfile looks like this: FROM alpine:3.10 RUN apk add --no-cache clang But when I'm trying to compile a hello world I'm getting the following error: $…
Denis Sheremet
  • 193
  • 1
  • 5
3
votes
1 answer

Problem with installing Clang: undefined symbol: LLVMInitializeMipsAsmParser

I'm new to Linux environment. Few days ago I've installed Fedora on my laptop. I want to complie some C++ source code but having trouble with Clang. First, after installing it with yum I see an error (whenever I call clang in the console): clang:…
pmakal
  • 31
  • 1
3
votes
1 answer

Can't seem to set environmental variables in fish correctly?

this is my fish configuration: set -x CGO_CPPFLAGS 'llvm-config --cppflags' set -x CGO_LDFLAGS 'llvm-config --ldflags --libs --system-libs all' set -x CGO_CXXFLAGS '-std=c++11' I've tried running make on my LLVM-based project, but I get the…
Jon Blow
  • 33
  • 2
2
votes
0 answers

Minimal c program does more system-calls than expected

I am trying to learn more about strace. I use strace to understand the calls a c program makes. The c program is: void _start () { for (;;) { } } The program gets compiled with clang -nostdlib littletest.c The system calls are traced…
2
votes
0 answers

How to build LLVM/Clang isolated from the host system?

I'm looking for something like the Linux From Scratch process for GCC, but for LLVM/Clang. Linux From Scratch builds an isolated GCC/binutils toolchain, and because of the rather monolithic nature, `the process is relatively simple. But how would…
user364814
  • 21
  • 1
2
votes
2 answers

Are there any successful forks or refactors of the Linux Kernel?

A google search reveals this slashdot story yielding this github repository that hasn't had a commit since 2016. There are 22,602 forks listed on github.com but these are going to be mostly (if not virtually all) simply development forks for…
mas
  • 1,849
  • 2
  • 18
  • 30
2
votes
1 answer

gdb doesn't step into function although source is available

I have a shared library compiled with -g -O0 including: void MyClass::whatever() { ... doSomething(myImage, myPoints); ... } bool MyClass::doSomething(const Image& image, std::vector& points) const { const int32_t foo = 1; …
Philippos
  • 13,237
  • 2
  • 37
  • 76
2
votes
3 answers

Made an oupsie while testing some protection and executed rm /usr/bin/clang*

I deleted clang. I tried to use apt to uninstall clang, and then re-install it but I get this error: Setting up clang (1:3.8-33ubuntu3.1) ... update-alternatives: error: alternative path /usr/bin/clang++ doesn't exist dpkg: error processing…
2
votes
0 answers

GCC/G++ compiles code to shared library instead of executable

I am having a rather puzzling problem. Recently, whenever I compile a program using GCC or G++, the compiler creates a shared library rather than an executable file. The library still runs if I execute it via CLI, but the system still treats it as a…
Techgineer
  • 21
  • 2
1
2 3 4