Skip to main content

Questions tagged [g++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
104 views

Is there any way to compile C++ code by g++ without any disk-writing? [closed]

I have a special Linux environment: all files and folders are read-only and G++ is installed. I am also unable to run sudo. I can just run a C++ program on it. I want to compile another piece of C++ ...
MrPython's user avatar
0 votes
0 answers
92 views

How to compile this SDL2 sample program?

I tried to build this SDL2 sample program, but failed. I made it with Makefile: CFLAGS = -I/usr/include CC = arm-linux-g++ sdltest: sdl2-test.cpp $(CC) sdl2-test.cpp -L/usr/lib/x86_64-...
Stan Huang at Taiwan's user avatar
0 votes
1 answer
31 views

Why can't such functions be found in specified libraries?

This is my command g++ -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2_image `sdl2-config --cflags --libs` sdl2-test.cpp -o sdl2-test I got result as below: /usr/bin/ld: /tmp/cc4uSTR6.o: in function `main'...
Stan Huang at Taiwan's user avatar
0 votes
0 answers
59 views

Failure to bootstrap GCC 13.2

I am trying to install the latest version of GCC 13.2 on my system: Linux minty-virtual-machine 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ...
Harith's user avatar
  • 111
0 votes
1 answer
57 views

Cannot install packages

I get the following whenever I try to install a package: (g++-12 in this case) Reading package lists... Done Building dependency tree... Done Reading state information... Done Correcting dependencies.....
ignatius's user avatar
  • 401
0 votes
0 answers
262 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
  • 141
4 votes
1 answer
23k 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
43 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
6k 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
2k 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
449 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
528 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
  • 441
0 votes
0 answers
105 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
  • 271
2 votes
1 answer
401 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
  • 55
5 votes
2 answers
2k 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
  • 155
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
649 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,601
11 votes
1 answer
8k 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,601
1 vote
1 answer
809 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
1k 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
177 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
  • 2,030
1 vote
1 answer
4k 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
986 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
6k 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
4k 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
594 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,717
1 vote
0 answers
452 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
  • 655
3 votes
1 answer
24k 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
889 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
222 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
2 votes
3 answers
2k 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
  • 23
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
  • 388
0 votes
1 answer
2k 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
63 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
515 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
3k 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
14k 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
928 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
  • 169
23 votes
5 answers
57k 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,393