Questions tagged [g++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
146 views

When using CMake and g++, the compiler output does not have any coloring or formatting

I'm using Fedora 38 (KDE, wayland), g++ 13.1.1, CMake 3.26.4, and GNU Make 4.4. My problem is as follows: When running g++ directly, the output (e.g. errors, warnings, ...) is nicely formatted, using ...
RL-S's user avatar
  • 131
1 vote
1 answer
14k views

How to install g++12 on Ubuntu 20.04?

I am working with some code that requires g++12 I was wondering how I could get this compiler on Ubuntu 20.4.4 If I need to install it from source how would I do that? I have tried a few things with ...
garrett_17's user avatar
0 votes
0 answers
33 views

How to compile JSVM reference implementation in 2022?

I need to compile the JSVM reference implementation. The code can be found here: https://vcgit.hhi.fraunhofer.de/jvet/jsvm The instructions included say one should use gcc version 4: # Building the ...
bouffelec's user avatar
1 vote
0 answers
5k views

Ubuntu 22.04 and GCC < 11

I've installed Ubuntu 22.04 fresh and it turns out it is using gcc/g++11: g++ --version g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Now, this won't work for many installation scripts and I'd like to have a ...
Jaegermeister's user avatar
1 vote
0 answers
1k views

error: *** A compiler with support for C++11 language features is required

I want to Build GCC 11 from source on Ubuntu 20.04. I had some problems in making package for ROS and hence I decide to update my GNU. my gcc and g++ versions are 11.1.0 when I extract the downloaded ...
Pouyan's user avatar
  • 13
1 vote
1 answer
370 views

Linker error by g++ when compiling to stdout

Let's say I have a C++ file called dummy.cpp, and I need to compile it with g++ in such a way that it's being from stdin and g++ spits the compiled binary out to stdout. If only the stdin part is ...
mraron's user avatar
  • 113
0 votes
1 answer
477 views

can you set c++ flags using the BASH make and cmake commands?

I'm using MX Linux debian 10 (buster), so I don't think I can update the compiler. Is there a way I can depreciate, or modify so that it is backwards compatible? For example, I am trying to compile ...
1toneboy's user avatar
  • 101
0 votes
0 answers
91 views

Boost build failed on Fedora-34

I am trying to install boost_1_55_0 on Fedora 34 (non-root user in a venv) I download the .tar.gz file I extract it using tar zxvf boost_1_55_0.tar.gz I cd into boost_1_55_0 I run ./bootstrap.sh I ...
M.A.G's user avatar
  • 231
2 votes
1 answer
328 views

Simple cpp program runs under standard GNU/Linux, but not MacOS M1

I've been writing a simple program under GNU/Linux (Debian) for quite some time, and recently I wanted to try it out under macOS running on the new M1 chip. However, g++ refuses to run it and throws a ...
j3ff's user avatar
  • 45
4 votes
2 answers
1k views

How to compile libstdc++ with specific compiler option?

I want to compile libstdc++ with the -fno-omit-frame-pointer option for profiling purposes, if possible. I was able to build libstdc++ by following https://gcc.gnu.org/install/index.html, but how can ...
nnnmmm's user avatar
  • 145
0 votes
1 answer
1k views

error with my gcc and g++

I'm trying to run a setup file for detectron project which is made by facebook company, but I got some errors which show there may be something wrong with my gcc/g++, it seems that these errors come ...
Kyrie Erving's user avatar
0 votes
1 answer
2k views

How long would it take to build GCC-10.2.0? [closed]

I'm building an LFS 10.1 system on a virtual machine with CPU Intel(R) Core(TM) i5-10210U CPU @ 1.60Hz(yes, it's a laptop) with 2 cores and 4GB of RAM. I'd like to know how long will the build process ...
mswgen's user avatar
  • 113
4 votes
1 answer
517 views

How to make GCC help option (`--help=`) display help information about `-L` and `-l` options for specifying libraries?

I have found the GCC help option --help= incredibly helpful for looking up information about options. However, while I can find lots of information using e.g. --help=common and --help=separate, I can'...
Shuzheng's user avatar
  • 4,203
10 votes
1 answer
6k views

How to statically link missing libgcc_s_seh-1.dll and libstdc++-6.dll DLLs for 9.3-win32 MinGW executable

I want to compile a simple Windows application on Linux using MinGW. I compile as follows: x86_64-w64-mingw32-g++ -L. -l:mathlib.dll -o fib main.cpp mathlib.h This results in an executable fib that ...
Shuzheng's user avatar
  • 4,203
1 vote
1 answer
701 views

What is the best way to determine missing dependencies when using G++ to compile a program with headers and static libraries?

I am trying to compile the demo for the Acontis etherCAT master stack, but G++ is reporting a number of undefined references when trying to compile, without giving any clue as to which headers or ...
JDD's user avatar
  • 21
1 vote
2 answers
951 views

How do I write a bash script to compile multiple files containing spaces?

This is the code I have: #!/bin/bash FILES=~/Desktop/cpp/$1/* mkdir ~/Desktop/cpp/$1o for f in $FILES do echo $(basename $f) >> ~/Desktop/cpp/$1err.log g++ '"'$f'"' -std=c++...
Kazi Siddiqui's user avatar
1 vote
1 answer
115 views

Search for packages from Ubuntu repositories whose names start with g++-

There are multiple versions of g++ packages in the default Ubuntu repositories. I already know that the package names of the packages that I am searching for all start with g++-, but searching for ...
karel's user avatar
  • 1,987
1 vote
1 answer
3k views

Issue with /usr/include/pci/pci.h missing on CentOS Linux, make of C++ applications with g++ fails

I am working on a large C/C++ development project, we are using Red Hat Enterprise Linux (RHEL) 6 for our development network, and also using g++ and gcc and also gmake. Management directed us to ...
Michael G. Workman's user avatar
0 votes
1 answer
908 views

make error 127 /bin/sh: 1: /usr/bin/g++: not found using Ubuntu

I am trying to make a program (hisat2) from the source code through Ubuntu. When I do, I get an error 127 and it says the following: /bin/sh: 1: /usr/bin/g++: not found Makefile:273: recipe for ...
student's user avatar
2 votes
1 answer
5k views

collect2: fatal error: cannot find ‘ld’ compilation terminated

I has unfortunately overridden the executable code in "/usr/bin/ld" So now ,when I run any c++ code try to execute it throws me and error collect2: fatal error: cannot find ‘ld’ compilation ...
Daniel Joe's user avatar
1 vote
1 answer
3k views

"C++ compiler cannot create executables" when trying to make

I'm running 32 bit CentOS 7. I'm trying to install tesseract from source. I have g++ version 4.8.5, and I had errors during compilation (looking like this) and I tried updating g++ from source. After ...
ImranD's user avatar
  • 113
1 vote
1 answer
555 views

Can't link to gtk+3.0 after update of the GCC compiler

On my Debian 9 system with Code::Blocks IDE I used to compile and link fine my gtk+3.0 application. But after update to the newest Debian 10 the linker cannot link to gtk+3.0 correctly. Here are the ...
Pekov's user avatar
  • 195
1 vote
2 answers
3k views

Can't build Darknet with CUDNN support

I`m trying to compile the sources from https://github.com/pjreddie/darknet using manjaro linux. But the build is having problems when I try to use the CUDNN switch. g++ -DOPENCV -I/usr/include/...
vfbsilva's user avatar
  • 3,677
1 vote
0 answers
422 views

error: Regular expressions are not functional, you need g++ 4.9.0 or greater

When I install the stacks in my Ubuntu 16.04: ... checking for sqrt... no checking for functional regular expressions... configure: error: Regular expressions are not functional, you need g++ 4.9.0 ...
244boy's user avatar
  • 635
3 votes
1 answer
20k views

G++/GCC installed but still: error trying to exec 'cc1plus': execvp: No such file or directory

Full error message: arm-linux-gnueabihf-g++: error trying to exec 'cc1plus': execvp: No such file or directory So I have got this error message while trying to build a C++ project on my machine ...
Josh Zindler's user avatar
1 vote
1 answer
3k views

Difference between the linker flags

I'm adding c++ runtime and exception support to the Linux kernel. For that, I need to provide my own lib/gcc and lib/libstdc++instead of the standard libraries provided by the compiler. So, I am ...
kjsr7's user avatar
  • 123
0 votes
3 answers
7k views

g++ can't find .so files in /usr/local/lib/ even when added to /etc/ld.so.conf, and ldconfig having been run

I am running Ubuntu 16.04. I have a C++ source file second.cpp which looks like this: #include <iostream> #include <boost/filesystem/operations.hpp> namespace bfs = boost::filesystem; ...
lboyd's user avatar
  • 1
-1 votes
1 answer
824 views

error: types may not be defined in ‘sizeof’ expressions

I'm trying to compile linux kernel verison 4.14.41 and got the following error: ./arch/x86/include/asm/acpi.h: In function ‘void arch_acpi_set_pdc_bits(u32*)’: ./include/linux/build_bug.h:30:45: ...
kjsr7's user avatar
  • 123
0 votes
1 answer
161 views

g++ -v says the program isn't currently installed but I know it is

I'm using Ubuntu 16.04 and when I run the command g++ -v I get The program 'g++' is currently not installed. You can install it by typing: sudo apt install g++ So then I run sudo apt install g++ ...
ryan pickles's user avatar
1 vote
3 answers
1k views

How can I limit the number of error messsages displayed after compiling a C++ program?

I am compiling a C++ program with g++ and each time get a huge number of errors, forcing me to scroll up every time I want to view the first (and most relevant) error. I am wondering if there is an ...
Adele's user avatar
  • 13
2 votes
0 answers
1k views

g++46: error trying to exec 'cc1plus': execvp: No such file or directory

I'm on FreeBSD 9.2. The gcc version is 4.2. My project needs c++11 so I install gcc 4.6 and in Codeblocks I change the build option to support c++11 and in toolchain section I write g++46 and gcc46. ...
F.M's user avatar
  • 378
0 votes
1 answer
1k views

Passing arguments to g++

I want to create a bash command for recursively finding all c++ files then returning last changed file (single file) and compile it, so far I wrote this find . -name '*.cpp' -type f -exec stat --...
Rami Chasygov's user avatar
10 votes
2 answers
12k views

How do I disable g++ displaying notes for errors?

When compiling, errors are often accompanied by a lengthy series of notes (cyan). Is there a g++ flag to disable this, only showing the error itself?
Jack's user avatar
  • 203
-1 votes
1 answer
61 views

Make issues while installing Fingerprint Feature Extractor software [closed]

I am trying to use an old software that extracts fingerprint data from an image. For the life of me, I cannot get the program to compile. I specifically am trying to run the make command and build the ...
Brandon's user avatar
2 votes
0 answers
493 views

cannot find -lm linker error

This question is highly related to cannot find -lm, but the error appears when I'm invoking cross G++ Linker. I'm trying to follow through the documentation provided by Using Eclipse with ARTIK SDK. ...
Hosea's user avatar
  • 121
0 votes
2 answers
4k views

Offline Install of g++ for Debian

I have an offline Debian machine onto which I need to install g++, gdb, etc. (I believe it's the "build essentials" package.) I do not have access to an online Debian machine from which to get ...
Dave's user avatar
  • 135
3 votes
4 answers
16k views

How can we install devtoolset-4.0 on CentOS 6.7

I tried to install devtoolset-4.0 to use g++ version 5.x via sudo yum install devtoolset-4 However, I got No package devtoolset-4 available. Is there any way to get to that?
mallea's user avatar
  • 131
2 votes
0 answers
2k views

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

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 ...
Techgineer's user avatar
11 votes
3 answers
20k views

How to install g++ 4.9 on debian stretch

I tried install on my Debian strench g++-4.9 and I didn't find package via apt-cache search g++-4.9 Oldest version I found only g++-5 Where can I get g++-4.9?
Schrami's user avatar
  • 113
1 vote
0 answers
2k views

configure failed because of See `config.log' for more details

I am trying to compile Tcl, but I got the following error: ~/apps/tcl8.6.6/unix> ./configure --prefix=$HOME/.local/Tcl checking whether to use symlinks for manpages... no checking whether to ...
user977828's user avatar
2 votes
2 answers
12k views

g++ - how to use -std=c++14 be default?

I want g++ to use -std=c++14 by default without having to type it every time. How would I do this?
Xan Nava's user avatar
-1 votes
1 answer
917 views

How to upgrade my g++ to 5.3 or 6

I am on Debian 7.9 and this question may seems very familiar to you, I have also seen some links, but when this was answered the GCC-5 was in testing place they suggested it as a work around, since we ...
RaGa__M's user avatar
  • 149
23 votes
5 answers
56k views

How to install GCC 5 on debian jessie 8.1

I tried many solutions to install update for my gcc compiler on debian server. None of them worked. I need the compiler update to use new features of c++11, as this provides a stable libcxx11 ABI, and ...
mluthra's user avatar
  • 331
3 votes
2 answers
5k views

Can I configure gcc to always output to the code file's name instead of a.exe?

By default, when running gcc test.c, gcc will output the executable as a.exe. Is there a way to globally override this so that gcc will create test.exe? This assumes that there's only one input file -...
Mark's user avatar
  • 41
3 votes
2 answers
3k views

problem finding g++ program, despite it being installed

gcc version 5.3.0 20151204 (Ubuntu 5.3.0-3ubuntu1~14.04) I have a problem with g++ When I search for g++ I find nothing! So I tried to install it; it seems like g++ is already installed and it's ...
0x0584's user avatar
  • 1,302
4 votes
5 answers
20k views

No space left on device on CentOS7

My machine which OS is CentOS7 have to backup 50G data into MySQL. But, there is no space left on the device. But there are many spaces on /home. How can I make user that there are enough space for ...
GoingMyWay's user avatar
0 votes
1 answer
128 views

g++ server.cpp -Wall

I have a program written in C++ in Linux I just download Vim editor I gave this command to compile: g++ server.cpp -Wall when I come to run it I use ./a but it does not work can give me the ...
Search's user avatar
  • 1
13 votes
4 answers
56k views

How to install latest stable release of GCC in Linux Mint?

I want to install the latest version of GCC (GNU compiler collection) in Linux Mint 17.3. Currently g++ --version returns 4.8.4, whereas the latest stable release is 5.3.
a06e's user avatar
  • 1,677
-1 votes
2 answers
4k views

Can't Compile Hyperion1.2 with g++ MinGW Compiler

Hey all I'm trying to compile Hyperion 1.2 and am getting errors. Here is the command I am using: x86_64-w64-mingw32-g++ Hyperion-1.2/Src/Crypter/hyperion.cpp -o Hyperion.exe The errors I'm getting:...
Isp99's user avatar
  • 1
0 votes
1 answer
632 views

Distcc ld error

I want to compile supertuxkart for notebook on my main computer (v-mint, with distcc daemon). My actions: Clone git+svn repos from official sources. (compile/{stk-code,stk-assets}). cd compile/stk-...
val - disappointed in SE's user avatar