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

learn more… | top users | synonyms

61
votes
7answers
167k views

Getting + installing gcc/g++ 4.9 on Ubuntu?

How do I install the latest version of gcc and g++? I am using a variety of C++11 and C++1y features; which is why I need this.
1
vote
1answer
5k views

Error: ‘strlen’ was not declared in this scope

I am trying to compile several third-party software from source code (i.e. zchaff, argosat) and get errors such as: Error: ‘strlen’ was not declared in this scope Error: ‘strcmp’ was not declared in ...
0
votes
1answer
824 views

install gcc and g++

I tried all the commands sudo apt-get build-dep build-essential sudo apt-get install gcc sudo apt-get install g++ But all time I am getting this error. The following packages have unmet ...
3
votes
2answers
8k views

G++ compilation error “cc1plus” not found

I think I accidentally deleted a couple files from my machine, and now G++ won't compile. I tried to apt-get remove it then apt-get install it to see if it would fix it, but it didn't work. Now I have ...
0
votes
1answer
2k views

“undefined reference to `std::ios_base::Init::Init()” while compiling a hello world in netbeans

I am new to ubuntu and I want to code in C++. I intalled g++ through software manager and after I installed netbeans to have a nice IDE to code in C++. Then I write this simple code: #include <...
-1
votes
1answer
186 views

How to run g++-4.7 installed in the machine using g++ command?

I am using Ubuntu 13.10(Saucy). I installed g++-4.7 in my machine. But when I tried to run g++ or tried to check the version it is showing that the package is not installed. $ g++ --version The ...
0
votes
1answer
2k views

“fatal error: GL/glfw.h: No such file or directory #include <GL/glfw.h>” - How to solve it?

I'm trying to install GLFW to develop a OpenGL 3.0+ program and I've followed a few tutorials on how to install GLFW and I keep getting this error. I know I have installed it correctly with cmake, ...
0
votes
1answer
178 views

what is the command for compiling a 32-bit binary in Ubuntu 13.10?

I am trying to compile my program. Normally I just put the command gcc example.c -o example . So this compiles the .run file into 64-bit. But I want it as 32-bit. What is the command? I have installed ...
0
votes
1answer
697 views

Unable to include libv8 in a c++ app

I was trying to use the libv8-3.8.9.20 package in my c++ script. The package is installed in /usr/lib/ as supposed but if I try to compile my script using g++ script.cpp -Iv8 command, nothing happens. ...
0
votes
1answer
2k views

How to install boost 1.53 or 1.54 from terminal?

I'd like to install boost 1.53 or 1.54 from terminal in Ubuntu 12.04. How do I do this? I used the libboost command and it gave me 1.48, whereas I need a more recent version. Thanks in advance
11
votes
3answers
9k views

Downloaded g++ 4.8 from the PPA but can't set it as default?

I have downloaded g++ 4.8 on Ubuntu 12.10 by doing: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install g++-4.8 but when I do: sudo update-alternatives --...
1
vote
1answer
8k views

Terminal commands for installing g++ 4.8?

Could somebody please advise how I could install g++ 4.8 ? I understand its not an official release yet (and that I would need to manually download a file) but I get internal compiler bug issues with ...
0
votes
1answer
2k views

“The program 'g++' can be found in the following packages”

I have g++ 4.6, 4.7 and 4.8 installed, but not g++ itself. I am using Ubuntu 12.04. If I do: g++ --version it says: The program 'g++' can be found in the following packages: * g++ * pentium-...
1
vote
2answers
2k views

Where or what are the instructions for installing FMOD Ex for Linux to use in g++?

I'm looking for the instructions on how to install FMOD. I want to do extra credit for my computer graphics assignment - sound effects. A teammate wants me to go with something simple, and he ...
0
votes
1answer
376 views

ld error while linking to SDL2

i'm struggling in the attept to compile c++ with SDL2. I've done as always: checkout the code (both from mercurial and libsdl.org) ./configure, make, sudo make install But it keeps to say: /usr/...
0
votes
1answer
460 views

Problem with function fpos_t and fgetpos [closed]

when I try to use those functions it sends this error: main.cpp: In function ‘int main()’: main.cpp:11:17: error: conversion from ‘int’ to non-scalar type ‘fpos_t {aka _G_fpos_t}’ requested main.cpp:...
-1
votes
1answer
1k views

How do I compile lbflow 1.1?

After using "sh ./configure" command, I encountered another error during lbflow package installation (a scientific one). The sequence of operations is here with error: ./configure --disable-gts ...
0
votes
1answer
2k views

Compiling c++ script with external libraries, not working

I can't seem to get this working. I have a c++ script that i haven't written myself, that i need to compile with g++. The start of the script looks like this: #include "x.hh" #include "y.hh" #...
18
votes
1answer
166k views

How to install g++ compiler?

I have tried the following: sudo apt-get install build-essential Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest ...
0
votes
1answer
1k views

g++ installation unmet dependencies error [duplicate]

I am trying to install g++.But not able to do it. amol@amol-System-Product-Name:~$ sudo apt-get install g++ [sudo] password for amol: Reading package lists... Done Building dependency tree ...
0
votes
2answers
433 views

not able to install g++

This is what I get when I run sudo apt-get install g++: libgtksourceview-3.0-0 is already the newest version. libgconf-2-4 is already the newest version. ibus-gtk is already the newest version. ...
0
votes
1answer
910 views

can't install g++ (worked fine before?)

Came back to my machine today, g++ won't run from the command line. output from sudo apt-get install g++: The following packages have unmet dependencies: fglrx : Depends: dkms but it is not ...
1
vote
0answers
2k views

gcc without g++?

I run Ubuntu 13.04 (x86_64 if it matters) which I recently installed. Before, when using 12.10, I had both gcc and g++ from the beginning. However, with 13.04 after I downloaded gcc-4.8.1 sources I ...
1
vote
1answer
2k views

Trying to compile code results in error: make[1]: g++-3: Command not found

I am trying to compile a program on Ubuntu 12.04 (LTS), but the following error keeps resulting: evensteven@pc:~/Desktop/MimoComplexLdpc$ make all cd ./src; make; make[1]: Entering directory `/home/...
1
vote
1answer
70 views

Is it possible to have two g++ executables with shared lib?

It might sound weird but I do want to have two g++ executables. One in normal /usr/bin/g++ which is currently working well. The other under /sandbox/g++ that is protected by apparmor. However when I ...
2
votes
1answer
3k views

./ 1.cpp commands gives error: bash: ./: Is a directory [closed]

After vi 1.cpp I write my C++ Program. g++ 1.cpp -o 1.out works fine. But ./ 1.out gives Error: bash: ./: Is a directory
0
votes
1answer
125 views

Compilation problem for C++ program

How do I install g++ or pentium builder packages? Do I need to download those? Because when I try to compile the program and with this statement: g++ -Wall -W -Werror main.cpp -o HelloWorldCPP` ...
1
vote
1answer
2k views

g++ error “sstream.tcc:112:39: error: expected unqualified-id before ‘(’ token”

I tried to install install one program at Ubuntu and it uses main.cpp .I dont know why but it gives always error.(main.cpp syntax correct 100%) and this program works without error @Mac system but not ...
0
votes
2answers
235 views

Error while installing g++ [duplicate]

I am getting this error: sathiesh@sathiesh:~$ sudo apt-get install g++ [sudo] password for sathiesh: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable ...
-3
votes
1answer
306 views

Is Gcc 4.8.1 RELEASE available under raring 13.04 ? ( no snapshot, only release )

I need full c++11 support and I need gcc 4.8.1 release, I'm under Ubuntu 13.04 64 bit, there is a gcc-snapshot package in the repository, but it's outdated and it's an old pre-release version. It's ...
1
vote
1answer
258 views

How to debug executable (using gdb) that reads another file?

I have a small application let's call it program. In general to use this application I need to stream a file into it: ./program < file_with_data.txt How do I debug such program using dbg? I don'...
0
votes
2answers
3k views

How to install gcc/g++ 4.4 and make links

Because I cannot compile some code by gcc/g++ 4.7, I want to install gcc/g++ 4.4. I searched the Internet and found some different way. I don't know what is the best solution. Is it possible to ...
0
votes
1answer
441 views

g++ fails to link to libmysqlclient

I use Ubuntu 12.04 on a virtual machine on my MacbookPro. I installed build-essential, mysql-server and libmysqlclient-dev. Both commands 'mysql' and 'mysql_config' work. However, the following ...
1
vote
1answer
5k views

How can i downgrade GCC 4.7.2?

i want to downgrade GCC and G++ 4.7.2 to some older versions, 4.0 perhaps. Any assistance? I'm using Lubuntu ATM.
6
votes
2answers
12k views

Ubuntu 13.04 with gcc/g++/gfortran 4.8 by default?

I plan to download and install Ubuntu 13.04 and I would like to have two compilers on my system. First question: what is the version of gcc/g++/gfortran shipped with ubuntu 13.04 ? (is it 4.7.3 ?). ...
0
votes
1answer
1k views

error in make: /usr/bin/ld: cannot find -lGL

I have a problem in makeing gpgpu-sim package in my Ubuntu. This is a ubuntu error and I do not know how to solve it in the make file I have this g++ -shared -Wl,-soname,libcudart.so \ ...
1
vote
3answers
35k views

g++ Installation

I tried installing gpp in my Ubuntu 12.04, but I can't install it. It reports, sudo apt-get install gpp [sudo] password for akash: Reading package lists... Done Building dependency tree ...
1
vote
1answer
2k views

Eclipse and the g++ - how is it work

I am using ubuntu 12.04. I have eclipse juno. I wrote test.cpp : #include <iostream> using namespace std; int main() { cout << "!!!Hello World!!!" << endl; // prints !!!Hello ...
1
vote
1answer
2k views

dlclose does not call library destructors, dlopen called just once

consider the following code for a dynamic loaded library built with g++-4.7 on linux, -fPIC and linked with -rdynamic option: typedef std::vector< void* > cbRegister_t; struct Wrapper {...
2
votes
2answers
610 views

Can't install g++ in Software Center

I can't install g++ in software center. I can install other programs. For example, after I found g++ can't be installed, I installed chrome for test purpose through software center, and it worked! ...
1
vote
1answer
4k views

How to compile a c++11 program using future in Ubuntu 12.04?

I'm trying to compile a c++ program in Ubuntu 12.04. I'm using g++ 4.7 (installed from a ppa). I'm using std::future, but I have an error. The code: $ cat main.cpp #include <iostream> #...
0
votes
1answer
5k views

How to compile c11 iso standard code with g++ compiler

System Details: $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS" $ g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4....
1
vote
2answers
7k views

gcc and g++ are installed but ubuntu says they are not installed

I have installed g++ and gcc from repository on ubuntu 12.04 ad you can see that they are indeed installed mahmood@pc:~$ dpkg -l | grep gcc ii gcc-4.4 4.4.7-1ubuntu2 ...
6
votes
3answers
1k views

How do I compile/run C++ code in the console?

I'm trying to run my C++ code using the console. I used the header file conio.h like I did when I used Turbo C++ IDE in Windows, and I ran the code in console using g++ filename.cpp I have ...
2
votes
1answer
954 views

When will GCC support C++11 regex_token_iterator?

When will GCC support for C++11 regex_token_iterator? Some of regex seems to be implemented, but the token iterator is not supported yet in my 32-bit Ubuntu/Linaro (version 4.7.2-4precise1) ...
1
vote
1answer
417 views

Restoring gcc and g++ flags

I've recently done something really stupid: I wanted to configure NetCDF libraries using the Intel Fortran compiler and, therefore, I was following instructions for that kind of procedure. ...
1
vote
1answer
614 views

linking cpp object file to c object file and create executable

Suppose i have a c++ file, created an object file and c file created another object file. Now i need to link both into one executable. While i'm trying it is giving errors about c++ not found. Can ...
6
votes
1answer
11k views

How to install g++ 4.8?

I have G++ 4.7.2 on my Ubuntu 12.04 and I'm trying to install 4.8. I downloaded the file from the GNU repository. After configure and make, I get the following error: collect2: error: ld returned 1 ...
2
votes
0answers
62 views

Cannot connect to ubuntuarchive.hnsdc.com, how to install g++? [duplicate]

Possible Duplicate: ‘Some index files failed to download’ while updating I am using Ubuntu 10.04. I typed sudo apt-get install g++ in the terminal and got the following output. I can't ...
0
votes
2answers
102 views

G++ execution Problem but compiles successfully

Hello Friends, can anybody explain me what is the error in this procedure of compiling and executing a c++ program file.