Questions tagged [g++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
119 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 ...
user avatar
  • 103
0 votes
1 answer
128 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 ...
user avatar
0 votes
0 answers
25 views

Why showing the dynamic library path to both the linker and the loader

To build and run an application in .cpp, I understand that the linker and the loader both need to know the path to the dynamic library (lib*.so). But, since in the linking steps the dynamic library is ...
user avatar
  • 1
0 votes
0 answers
25 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 ...
user avatar
  • 171
2 votes
1 answer
104 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 ...
user avatar
  • 35
2 votes
1 answer
187 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 ...
user avatar
  • 125
0 votes
1 answer
418 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 ...
user avatar
0 votes
1 answer
584 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 ...
user avatar
  • 113
2 votes
1 answer
306 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'...
user avatar
  • 3,357
9 votes
1 answer
2k 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 ...
user avatar
  • 3,357
1 vote
1 answer
286 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 ...
user avatar
  • 21
1 vote
2 answers
451 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++...
user avatar
1 vote
1 answer
47 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 ...
user avatar
  • 1,779
1 vote
1 answer
2k 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 ...
user avatar
0 votes
1 answer
495 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 113
1 vote
1 answer
421 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 ...
user avatar
  • 185
1 vote
2 answers
2k 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/...
user avatar
  • 3,494
1 vote
0 answers
307 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 ...
user avatar
  • 613
2 votes
1 answer
13k 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
0 votes
3 answers
5k 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; ...
user avatar
  • 1
-1 votes
1 answer
678 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: ...
user avatar
0 votes
1 answer
83 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++ ...
user avatar
0 votes
3 answers
676 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 ...
user avatar
  • 3
1 vote
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. ...
user avatar
  • 308
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 --...
user avatar
9 votes
2 answers
10k 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?
user avatar
  • 193
-1 votes
1 answer
53 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 ...
user avatar
2 votes
0 answers
443 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. ...
user avatar
  • 121
0 votes
2 answers
3k 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 ...
user avatar
  • 135
3 votes
4 answers
15k 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?
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 ...
user avatar
11 votes
3 answers
19k 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?
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 ...
user avatar
2 votes
2 answers
9k 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?
user avatar
-1 votes
1 answer
856 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 ...
user avatar
  • 149
22 votes
4 answers
55k 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 ...
user avatar
  • 321
3 votes
2 answers
4k 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 -...
user avatar
  • 41
2 votes
2 answers
2k 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 ...
user avatar
  • 1,104
4 votes
5 answers
19k 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 ...
user avatar
0 votes
1 answer
96 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 ...
user avatar
  • 1
12 votes
4 answers
53k 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.
user avatar
  • 1,497
-1 votes
2 answers
3k 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:...
user avatar
  • 1
0 votes
1 answer
571 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-...
user avatar
12 votes
1 answer
35k views

g++ doesn't recognize standard 14 (-std=c++14)

I'm on Ubuntu 14.04 and have g++ 4.8.5 (Ubuntu 4.8.5-2ubuntu1~14.04.1). When trying to use -std=c++14 parameter, g++ outputs: unrecognized command line option '-std=c++14' Even when running apt-get ...
user avatar
0 votes
1 answer
4k views

ld error "/opt/bin/ld: skipping incompatible /lib/libm.so.6 when searching for /lib/libm.so.6" when using g++

I run into this error when I try to test compiling a very simple program: #ifdef __cplusplus extern "C" #endif int main () { return 0; } And I got the following error message if I compile using g++: ...
user avatar
1 vote
2 answers
408 views

stuff in quotes are hidden in the compilation error message for gcc?

this happens with both g++ and gcc as whenever I tried gcc file_name and the above happens.
user avatar
1 vote
1 answer
357 views

I had g++, was using it, installed make, and now g++ is impossible to install

I am running Debian 8.1. I installed g++ via the terminal using apt-get. I then installed build-essential, and saw something in the terminal about "removing g++". I freaked out a little, because I've ...
user avatar
  • 73