g++

g++: internal compiler error: Segmentation fault (program cc1plus) - where do I start?

↘锁芯ラ 提交于 2021-02-07 04:18:46
问题 I am porting code that compiled on Ubuntu 14.04 to 16.04 . I have cloned my git repo, installed dependencies and tried the usual make command, soon I hit a g++: internal compiler error: Segmentation fault (program cc1plus) ... yet I am not sure where to start to diagnose and resolve this issue. I will share as much as I can, see if someone can guide me through a resolution. Ubuntu $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16

Linking error: undefined reference to `vtable for XXX`

吃可爱长大的小学妹 提交于 2021-02-06 09:43:45
问题 There is some linking error here. I looked for that online, yet still I couldn't find the problem. How can I fix it? g++ test.cpp -o test /tmp/ccDfCj4N.o: In function `Interval::Interval()': test.cpp:(.text._ZN8IntervalC2Ev[Interval::Interval()]+0x9): undefined reference to `vtable for Interval' /tmp/ccDfCj4N.o: In function `IntInterval::~IntInterval()': test.cpp:(.text._ZN11IntIntervalD0Ev[IntInterval::~IntInterval()]+0x1d): undefined reference to `Interval::~Interval()' /tmp/ccDfCj4N.o: In

__cplusplus < 201402L return true in gcc even when I specified -std=c++14

有些话、适合烂在心里 提交于 2021-02-06 06:36:13
问题 The directive: #ifndef __cplusplus #error C++ is required #elif __cplusplus < 201402L #error C++14 is required #endif The command-line: g++ -Wall -Wextra -std=c++14 -c -o header.o header.hpp My g++ version: g++ (tdm-1) 4.9.2 The error C++14 is required is generated even when I added -std=c++14 , I don't know why. Please tell me how to fix this. 回答1: According to the GCC CPP manual (version 4.9.2 and 5.1.0): __cplusplus This macro is defined when the C++ compiler is in use. You can use _

__cplusplus < 201402L return true in gcc even when I specified -std=c++14

巧了我就是萌 提交于 2021-02-06 06:35:36
问题 The directive: #ifndef __cplusplus #error C++ is required #elif __cplusplus < 201402L #error C++14 is required #endif The command-line: g++ -Wall -Wextra -std=c++14 -c -o header.o header.hpp My g++ version: g++ (tdm-1) 4.9.2 The error C++14 is required is generated even when I added -std=c++14 , I don't know why. Please tell me how to fix this. 回答1: According to the GCC CPP manual (version 4.9.2 and 5.1.0): __cplusplus This macro is defined when the C++ compiler is in use. You can use _

__cplusplus < 201402L return true in gcc even when I specified -std=c++14

亡梦爱人 提交于 2021-02-06 06:30:50
问题 The directive: #ifndef __cplusplus #error C++ is required #elif __cplusplus < 201402L #error C++14 is required #endif The command-line: g++ -Wall -Wextra -std=c++14 -c -o header.o header.hpp My g++ version: g++ (tdm-1) 4.9.2 The error C++14 is required is generated even when I added -std=c++14 , I don't know why. Please tell me how to fix this. 回答1: According to the GCC CPP manual (version 4.9.2 and 5.1.0): __cplusplus This macro is defined when the C++ compiler is in use. You can use _

Why do -ansi and -std=c++11 conflict in g++?

一个人想着一个人 提交于 2021-02-04 19:04:42
问题 Why does -ansi and -std=c++11 doesn't work together ? (ANSI reverts back to C++98 according to other answers) I am using g++-4.8. Here is the ANSI ratification of C++11 : http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2012 This leaves me perplex. Thanks! 回答1: RTFM: -ansi In C mode, this is equivalent to -std=c89 . In C++ mode, it is equivalent to -std=c++98 . The flag was added before there were multiple versions of the standard, and the flag still has the same

make: g++: Command not found

雨燕双飞 提交于 2021-02-04 16:56:22
问题 I've checked similar posts and anyone solve my problem. I's very simple but I'm new with eclipse. I'm trying to make a simple example and I'm having this problem. the make file is just this all: hello.exe clean: rm Hello.o Hello.exe hello.exe: hello.o g++ -g -o hello.exe hello.o hello.o: g++ -c -g main.cpp And I get this error "make: g++: Command not found" Thanks for helping. 回答1: You need to install the development tools from GNU. I assume you're on windows, in which case you have two

Run-time linking to dynamic libraries not on LD_LIBRARY_PATH

只愿长相守 提交于 2021-02-04 16:32:40
问题 I'm trying to link a project of mine to a particular set of custom-compiled libraries placed on the project's base directory [proj_dir]/lib - not on any of the system's /lib, /usr/lib or /usr/local/lib - to avoid conficts with the installed stock versions of those same libraries. I'm able to compile the project by passing the library path with the -L flag, but I get error while loading shared libraries libXXX.so: cannot open shared object file: No such file or directory when I run the

Run-time linking to dynamic libraries not on LD_LIBRARY_PATH

萝らか妹 提交于 2021-02-04 16:32:29
问题 I'm trying to link a project of mine to a particular set of custom-compiled libraries placed on the project's base directory [proj_dir]/lib - not on any of the system's /lib, /usr/lib or /usr/local/lib - to avoid conficts with the installed stock versions of those same libraries. I'm able to compile the project by passing the library path with the -L flag, but I get error while loading shared libraries libXXX.so: cannot open shared object file: No such file or directory when I run the

CMake can not find g++ compiler on Windows

喜欢而已 提交于 2021-02-04 16:09:18
问题 I have a CMake project I want to compile with g++. The project compiles and runs on Linux. Now I am trying to get it working on Windows. For that reason, I installed MinGW and added it to the PATH and I am using Git Bash. In order to force CMake to use g++ I added these env variables: CC = C:\MinGW\bin\gcc CXX = C:\MinGW\bin\g++ But when I run CMake it does not detect any compilers and tells me: -- The C compiler identification is unkown -- The CXX compiler identification is unkown I created