Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [g++]

G++ is the C++ front-end of the Gnu Compiler Collection (GCC)

9
votes
1answer
994 views

Disabling C++11 in GCC 7.3

It seems like in Ubuntu 18.04, the default shipped g++ (version 7.3.0) runs in C++11 compatible mode by default. I am getting some errors in my old codes which are not C++11 compatible. I installed g++...
0
votes
0answers
44 views

Failed to update system or install any program on Ubuntu 18.04 - too many levels of symbolic links usr/bin/g++

I have some problem which I don't know how to solve. I am using Ubuntu 18.04 and when I try it to update it by typing: sudo apt-get update sudo apt-get upgrade In a second line I got: Reading ...
1
vote
1answer
32 views

Issue with gcc/g++ while cmake building (./bootstrap)

I decided to reinstall cmake but after removing it I am having an Issues with installing. After entering a ./bootstrap It prints I am using type of g++ which I dont know how I got it CMake 3.12.0, ...
-1
votes
0answers
20 views

I'm using ubuntu 16.04 LTS.My g++ version is 5.4.0 . How can I upgrade it to a newer version. I have downloaded gcc7.3.0 [duplicate]

I'm a newbie so please give me some code instead of instructions,coz if anythign goes wrong i pretty much won't be able to fix it.
0
votes
0answers
20 views

How could I switch OpenMPI library based on the gcc/g++ version?

Using the methods describe here I could easily switch gcc version with update-alternatives. Now, I have two versions of openmpi-3.1.1 that is compiled for each of them, namely: /home/user/me/.local/...
-1
votes
1answer
120 views

'Bash ./main: No such file or directory' error while trying to execute a C++ program

The code snippet: #include <iostream> using namespace std; int main(){ unsigned int a, b, diff; cin>>a>>b; diff = a - b; if(diff % 10 == 9){ diff--; }...
0
votes
0answers
36 views

Possible to install g++ 5 on 14.04 offline?

for reasons too long to delve into I'm wondering if it is not possible to install g++5 (or c++14 compliant) C++ compilers on a machine running 14.04 with NO network access. I'm working on building a ...
0
votes
0answers
34 views

“SigPack - the C++ signal processing library” installation and run help

I am still new to Linux and I'm trying to install "SigPack-a signal processing library". Instructions on SourceForge(http://sigpack.sourceforge.net/build.html) are pretty vague but I managed to ...
1
vote
0answers
312 views

Upgrade to python 2.7.15 (for gdb 8) on Ubuntu 16.04

I am running Ubuntu 16.04 with gdb version 7.11.1-0ubuntu1~16.5. When I upgraded g++ to g++-6.4 (Ubuntu 6.4.0-17ubuntu1~16.04), gdb started giving python errors like: Python Exception <class '...
0
votes
0answers
63 views

g++ libraries under Windows Subsystem for Linux (WSL)

How can I know where and what exactly are the g++ libraries in my WSL (Ubuntu 16.04)? Would the libraries be influenced by those under Windows?
0
votes
0answers
117 views

Using mpicc with update-alternatives

Since I am using CUDA 9.1 on Ubuntu 18.04, I need to use gcc-6 as suggested here. To deal with 2 versions of gcc (Ubuntu 18.04 comes with gcc-7), I have adopted the update-alternatives method as ...
0
votes
0answers
29 views

Can't configure custom GCC version after installation

I build GCC 6.3.0 according to the answer here After sudo make install I am trying to configure it. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /...
1
vote
1answer
43 views

Can not open cpp excutable after compilation [duplicate]

I am having problem executing a cpp file after compilation. Here is the text output and how I compile it and try to run. coovi@coovi-Surface-Book:~/HW9$ g++ -Wall main.cpp -g -o main coovi@coovi-...
0
votes
1answer
76 views

Unable to install g++ compiler in Ubuntu 16.04

First I updated like this sudo apt-get update last it shows like below: Fetched 323 kB in 1s (247 kB/s) Reading package lists... Done Then I install g++ compiler....
-1
votes
3answers
271 views

Why do I get syntax error when I try to run my C++ program after compiling it?

I am trying to learn C++, but I can't even make the first (hello world) example from cplusplus.org work with g++ command or c++. I created a file just like the example and ran g++ myfile, then ./...
1
vote
0answers
121 views

cannot cross-compile a c++11 program with multithreads using cmake

When I first tried to run the program, I got the following output: This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, ...
0
votes
0answers
52 views

How can I get core dump info which is happened while compiling

I encountered a core dump when compiling a linux project. the outpu/log is belows: collect2: error: ld terminated with signal 6 [Aborted], core dumped * Error in `/opt/toolchain/arm-2014.11//arm-linux-...
1
vote
1answer
60 views

Code::blocks 16.01 not compiling

I have Ubuntu 17.10 and Code::Blocks 16.01. I cannot build and run simple code like "Hello World!". -------------- Build: Debug in program (compiler: GNU GCC Compiler)--------------- g++.exe -Wall -...
0
votes
0answers
159 views

Ubuntu 17.10 gcc version 6.3 (not 6.4) for MATLAB support

The required version of GCC for Matlab is 6.3. Ubuntu 17.10 ships with gcc 7.2. The package gcc-6 is available, but that is version 6.4, which doesn't work with MATLAB. Does anyone know a way to ...
-1
votes
1answer
39 views

Simple C++ Thread Program Can't Be Compiled

The following is my 1st multi-threaded program. But while it was compiled, there is a linking error. The part of the error message: std::thread::thread<void (&)(int), int&>(void (&...
1
vote
1answer
354 views

How to install g++ in Ubuntu 17.10?

I've tried sudo apt-get install g++ but I've faced the following error: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be ...
0
votes
0answers
102 views

Error upgrading g++ No such file or directory: '/usr/lib/python3/dist-packages/scipy/lib/decorator.py'

I was trying to update g++ to compile in c++. Then, doing: sudo apt install --only-upgrade g++ I get the following error: sh: 0: getcwd() failed: No such file or directory Setting up python3-...
1
vote
1answer
261 views

How to integrate the default g++ compiler with vscode?

I installed Ubuntu 16.04LTS about a week ago. Also, I installed 'Visual Studio Code (VScode)' to do some c++ programming but I couldn't find any article on the Internet that explicitly explains how ...
0
votes
1answer
83 views

lib not found (ncurses)

I'm trying to compile this c++ project: https://github.com/YvesZHI/FallingCode I've successfully compiled it on my Mac OS, however, when I try to compile it on my ubuntu16.04, I get errors as below: ...
0
votes
0answers
25 views

Installing G++ 3.4.2 to a specific prefix/suffix [duplicate]

I'm submitting code to an Online Judge which uses G++ 3.4.2, but my computer has G++ 7.2.0 installed from apt. I'd like to install the older version of G++ and GCC to g++-3.4.2 and gcc-3.4.2 instead ...
2
votes
0answers
2k views

How to install gcc-4.9 on ubuntu 17.10(artful)

can someone help me to install gcc/g++ 4.9 on artful? there is no package for artful in repository just for 16.04(Xenial) and 17.04(Zesty)
0
votes
0answers
35 views

How to compile avx assembly in Ubuntu virtual machine?

I'm trying to compile some avx instructions { double* dst = NULL; const int* ait = a; int N=0; const int* aend = a+N; __asm__ __volatile__ ( "0:\n" "vmovupd (%...
1
vote
1answer
817 views

g++ gcc include files not found

I have posted on another site, so hopefully this isn't cross posting: I have a few versions of gcc and g++ on my Ubuntu 16.04 which i select with alternative config. When compiling a very simple ...
0
votes
1answer
249 views

Error: build-essential : Depends: g++ (>= 4:4.4.3) but it is not going to be installed

I'm trying to install build-essential using sudo apt-get install build-essential command. I get this error: The following packages have unmet dependencies: build-essential : Depends: g++ (>= 4:4.4....
0
votes
1answer
182 views

g++ uses OpenGL 3.0 but I have 4.5

In the c++ code I put the line fprintf(stdout, "%s\n", glGetString(GL_VERSION)); and it outputs 3.0 Mesa 17.3.0-devel although $ glxinfo | grep "version" server glx version string: 1.4 client glx ...
0
votes
0answers
76 views

g++ Conflicts appeared

When I type: g++ --version in a console, I get the message: The program 'g++' is currently not installed. You can install it by typing: sudo apt install g++ But, when I type: sudo apt install g++...
0
votes
0answers
239 views

sudo apt-get install make g++ libssl-dev binutils error

Does anyone have code to replace this, I have tried all suggestions so far. The following packages have unmet dependencies: g++-4.8 : Depends: gcc-4.8-base (= 4.8.2-19ubuntu1) but 4.8.4-2ubuntu1~14....
1
vote
1answer
1k views

g++ cant find cstdlib (fatal error: cstdlib: No such file or directory) [closed]

Im trying to compile the very simple c++ Program //Programm, um Celcius in Fahrenheit umzurechnen // F=C*(212-32)/100+32 #include <cstdio> #include <csdtlib> #include <iostream> ...
2
votes
1answer
584 views

Update gfortran library

I am confused by the versions I have on my machine. I am running Ubuntu 16.04. The output of gcc --version and g++ --version tells me that I have 7.2.0 installed. Great! When I do gfortran --...
1
vote
1answer
490 views

How do I compile face_landmark_detection_ex, which requires dlib?

I am given this code for a program called face_landmark_detection_ex. There is no makefile. How can I find out what command I need to type in, in Ubuntu, to produce an executable that I can run? I ...
0
votes
0answers
2k views

Cmake fails with error: “Could not find compiler set in environment variable CC”

I am brand new to Linux/Ubuntu. I installed Ubuntu two days ago to run ROSS (Rensselaer's Optimistic Simulation System) developed by Argonne National Lab. However, I have been running into some build/...
0
votes
1answer
1k views

Unable to install g++ in Ubuntu 17.04

This is my problem: sudo apt-get install g++ Reading package lists... Done Building dependency tree Reading state information... Done g++ is already the newest version (4:6.3.1-2ubuntu1). 0 ...
0
votes
0answers
2k views

installing opencv gives error unsported GCC version despite use of alternative

I'm trying to install opencv 3.1. I have downloaded opencv (https://github.com/Itseez/opencv_contrib/archive/3.1.0.zip) and unzipped it. Now according to various tutorials I should be able to compile ...
0
votes
1answer
123 views

Compiler Problem

I have no clue anymore and I have to ask some clever people now, since I just recently started working with Ubuntu. Soo here is the Problem: I got Ubuntu 16.04 on a Virtual computer via VirtualBox (...
0
votes
0answers
11 views

Unable to install g++ on Ubuntu. Apt-get presents a “Mergelist” problem [duplicate]

$ sudo apt-get update ... Fetched 6,406 kB in 15s (406 kB/s) Reading package lists... Error! E: Encountered a section with no Package: header E: Problem ...
0
votes
1answer
254 views

Cannot compile C++ files on Ubuntu Server 14.04.5 (version.h error)

I have tried using make and G++ to compile C++ files on my Ubuntu VPC... when I attempt to compile it leads with the following error: Daemon.cpp:5:21: fatal error: version.h: No such file or ...
0
votes
0answers
34 views

Can't install g++ with APT due to dependency issue [duplicate]

I type sudo apt install g++ in Terminal, but i get this: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may ...
0
votes
1answer
603 views

Unable to compile Omnet++ in Ubuntu 16.04 - make errors

I've followed installation instructions mentioned in: https://omnetpp.org/doc/omnetpp/InstallGuide.pdf Then followed the instructions mentioned in: http://vikashmainanwal.blogspot.co.il/2014/10/...
0
votes
0answers
205 views

Compiler has trouble finding Python.h

I keep trying to test-compile a simple "hello world" with the gnu compiler on Ubuntu 16.04. The twist is that I am doing THAT because I wanted to make sure the compiler could find the <Python.h> ...
4
votes
2answers
197 views

Can I write an alias that takes an argument? [duplicate]

I have some remote machines, where I need to compile some source code. What I normally do is write an alias, that says something like: alias g++='g++ `pkg-config --cflags opencv --libs opencv`' Then ...
1
vote
0answers
152 views

Errors of “sudo apt-get update” when I update g++/gcc to 4.8

The old g++/gcc version on my computer is 4.6.3. I need to update it to 4.8, because some softwares I want to install are required. But when I update g++/gcc on ubuntu 12.04 as follow command, there ...
0
votes
2answers
668 views

Setting up symlink for g++?

Currently, this is setup such that g++ points to g++-5. lrwxrwxrwx 1 root root 5 Feb 11 2016 g++ -> g++-5 However, if I were to do ln -s /usr/bin/g++-5 /usr/bin/g++, I would then get ...
0
votes
1answer
139 views

Why can't g++ find my source code?

I just started with C++ on Ubuntu and I'm already stuck. I made my first .cc program and tried to compile it with g++. I named it variabili.cc and saved it in a folder called Esercizi on my Desktop. ...
0
votes
1answer
577 views

G++ compiler doesn't show any output

I'm a newbie and I'm stuck with the basic stuff. A friend of mine showed me Geany and Ubuntu to code C++ and I loved them, so I downloaded Ubuntu an hour ago. I've got the IDE but when I try to ...
2
votes
2answers
8k views

How do I install g++-7 on Ubuntu?

How can I install g++-7 on Ubuntu? I did sudo add-apt-repository ppa:ubuntu-toolchain-r/test Then I can find g++-5, g++-6 packages, but not g++-7. What problems may I encounter when using g++-7? ...