33
votes
How to install gcc-7 or clang 4.0?
Super mega GCC table for all Ubuntu versions: How do I use the latest GCC on Ubuntu?
Ubuntu 16.04 and below
There is an official Ubuntu GCC test PPA which should be preferred:
sudo add-apt-...
33
votes
Installing clang 5.0 and using C++17
Install clang-5 from llvm.org repositores
First, we should add the llvm.org repositories to our sources lists, the line that we should add is:
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5....
33
votes
Accepted
Where do I find the core dump in ubuntu 16.04LTS?
In Ubuntu the core dumps are handled by Apport and can be located in /var/crash/. But it is disabled by default in stable releases.
To enable Apport, run: sudo systemctl enable apport.service or sudo ...
26
votes
Accepted
Installing and using universal-ctags instead of exuberant-ctags
It is simple, as in the universal-ctags docs:
git clone https://github.com/universal-ctags/ctags.git
cd ctags
./autogen.sh
./configure
make
sudo make install
26
votes
Accepted
How to install gcc-7 or clang 4.0?
You can already install gcc-7 and g++-7 from this package.
sudo add-apt-repository ppa:jonathonf/gcc-7.1
sudo apt-get update
sudo apt-get install gcc-7 g++-7
24
votes
Accepted
How to install Point Cloud Library v1.8 (pcl-1.8.0) on Ubuntu 16.04.2 [LTS] for C++?
INSTALLATION
Install oracle-java8-jdk:
sudo add-apt-repository -y ppa:webupd8team/java && sudo apt update && sudo apt -y install oracle-java8-installer
Install universal pre-...
24
votes
Accepted
Can I act on the event that a window opens without polling?
I found two ways of solving this problem.
Use the xprop -spy -root _NET_ACTIVE_WINDOW command in combination with grep in a bash script.
Create a C++ (could have been C or python as well my project ...
23
votes
Accepted
Compiling C++20 program that uses modules with Ubuntu 22.04
Module support in g++ is not complete as of the date of posting. In particular,
Standard Library Header Units
The Standard Library is not provided as importable header units. If you want to import ...
22
votes
Accepted
Disabling C++11 in GCC 7.3
Try adding -std=gnu++98, it was probably the default for gcc 6.4.0.
Example:
g++ -std=gnu++98 hello.cpp -o hello
21
votes
How to set Clang 9 as the default C++ compiler on Ubuntu 19.10?
Install clang version 9 from the default Ubuntu repositories in Ubuntu 19.10 and later.
sudo apt install clang-9
/usr/bin/c++ is actually a symbolic link to:
/etc/alternatives/c++
which in turn is ...
21
votes
Accepted
clang++ cannot find iostream
I spoke to a colleague who told me that gcc-12 was included in ubuntu 22.04 an created some mess with clang. To solve the issue, I did
sudo apt install g++-12
and now it works well.
19
votes
Accepted
How can I write a dynamically updated panel app / indicator?
Since what seems to be the occasion to ask this question already has an answer, I am answering this question as an extended explanation on how it was done (in python)
Basic static indicator
Since ...
18
votes
C/C++ option not available in NetBeans
The answer provided by https://askubuntu.com/users/22949/eliah-kagan did not work for Ubuntu 19.04 with NetBeans 11 since the C++ plugin is not available under "Netbeans Distribution" when I tried it. ...
18
votes
Where do I find the core dump in ubuntu 16.04LTS?
All the above did not worked for me...
I looked at /var/log/apport.log:
cat /var/log/apport.log
and I saw the file name:
ERROR: apport (pid 3426) Mon Nov 8 14:34:07 2021: writing core dump to core....
18
votes
Accepted
Installing latest cmake on Ubuntu 18.04.3 LTS run via WSL: OpenSSL error
I ran into the same problem last year. My solution was this:
run the following in your WSL terminal
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates gnupg software-...
17
votes
Accepted
X11/extensions/Xcomposite.h: No such file or directory
Whenever a compile fails with a missing file simply leverage the infrastructure to search for the missing ubuntu package
apt-file search some_missing_file_goes_here # cmd 1
apt-file search ...
15
votes
Accepted
Install latest cmake binary and accept licence automatically
If you run the installer with --help you should find that it has a --skip-license command line option:
$ ./cmake-3.10.0-rc4-Linux-x86_64.sh --help
Usage: ./cmake-3.10.0-rc4-Linux-x86_64.sh [options]
...
14
votes
Installing and using universal-ctags instead of exuberant-ctags
I'm on Ubuntu, and for me I can use either:
sudo apt install universal-ctags
or
sudo snap install universal-ctags
The snap has the advantage that it will work on any Ubuntu release (or on any other ...
14
votes
clang doesn't find c++ stdlib on my ubuntu 18.04, but it does on a brand new install. What have I broken?
Here is what I learnt:
clang by default looks for the gcc standard C++ library and it stops if this doesn't work.
It looks for the highest version. The highest version is determined by the highest ...
14
votes
Accepted
How to get libstdc++ with C++17/filesystem headers on Ubuntu 18 (bionic)?
Whenever a C++ compilation error says the <filesystem> header is not found it is because GNU libstdc++ prior to 9.1 and LLVM libc++ prior to 9.0 have not implemented std::filesystem yet.
EASY ...
13
votes
Accepted
How to use notify-send with C++?
Okay so this is how I did it. First install libnotify-dev:
sudo apt-get install libnotify-dev
this will install the lib on your system and put the headers of the lib to /usr/include/libnotify/
You ...
13
votes
Accepted
Save terminal output to a txt file
It should work the way you want if you wrap the command in a command group or subshell:
{ time ./blur-effect 4k.png 4k_out16.png 16 15 ; } &>> Output.txt
or
(time ./blur-effect 4k.png ...
12
votes
C, C++ and Java IDE for Ubuntu
There's Eclipse available from the repository. You can install it with:
$ sudo apt install eclipse
Or by the GUI Search of the Ubuntu Software center. A search of the word "IDE" will bring up a ...
12
votes
How do I use the latest GCC on Ubuntu? (Ubuntu 18.04; gcc 8.1)
The package name is gcc-8, not gcc-8.1, so try:
sudo apt-get install gcc-8 g++-8
As others mentioned, make sure you've added the toolchain test PPA:
sudo add-apt-repository ppa:ubuntu-toolchain-r/...
12
votes
Accepted
C++ fmt library installation is not working
Most packages and libs don't need to be manually downloaded and installed on Ubuntu. You can install libfmt-dev using the somewhat official "universe" repository using apt.
Run the following commands ...
12
votes
GLIBCXX 3.4.30 not found in conda environment
I got a very similar issue, and solved it by linking the the lib file into the conda environment. For your situation you may try something like this:
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /...
10
votes
Accepted
Update GCC to the 6.3 version
The only option exist is to Build it from Sources, since you're running Vivid (15.04) version which has reached EOL (End Of Life).
Download the source code and its prerequisites:
wget https://ftp....
10
votes
Why do I get "undefined reference" errors compiling a simple C++ program with gcc?
C++ programs need to be linked with the C++ standard library. Although you could link the standard library manually i.e. gcc -o hello hello.cpp -lstdc++, it's not generally done like that. Instead, ...
10
votes
Accepted
QtCreator not recognizing linked libraries after upgrading Ubuntu to 20.04
Same issue here, same solution as @nou. QtCreator 4.11 still relies on clang-8, but on Ubuntu 20.04 apt will install clang-10. The following solved the problem for me:
Install clang 8
sudo apt ...
9
votes
Accepted
Undefined references compiling clang tutorial on 14.04.2
The order of the cpp file and the clang libraries matters, as well as the order of clang libraries. I made it successfully link by using
g++ `llvm-config --cxxflags --ldflags` tool.cpp $CLANG_LIBS `...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c++ × 790compiling × 169
gcc × 95
g++ × 70
c × 58
command-line × 54
application-development × 47
programming × 44
libraries × 42
14.04 × 40
qt × 39
software-installation × 35
apt × 34
cmake × 34
12.04 × 31
qml × 30
16.04 × 29
make × 29
eclipse × 27
bash × 26
boost × 26
python × 24
ubuntu-touch × 24
code-blocks × 24
ubuntu-sdk × 21