Questions tagged [gcc4.7]

Version 4.7 of GCC (GNU Compiler Collection). GCC is the de facto standard C compiler on Linux (though version 4.7 is not used by modern versions of Linux). The compiler collection supports many other languages and platforms as well.

Version 4.7.0 was released on 2012-03-22. Version 4.7.4 was released on 2014-06-12.

See also:

136 questions
4
votes
1 answer

Possible to access private types in base classes via template indirection

I'm trying to, at compile time, select a type to use depending on whether one is publicly available in a given scope. It's best to go straight to the code: #include #include class Logger { std::string _p; public: …
Nim
  • 33,299
  • 2
  • 62
  • 101
4
votes
1 answer

Compiling C++ code on Linux. Need to use gcc/4.7.2. Can't locate standard libraries

I am a bit of a newbie as far as dealing with compilation/linking errors. I'm working with a large C++ code (there are a few C files as well). I have successfully been running it on a Mac, compiled with g++. Now I need to run it on a Linux-based…
Ant
  • 753
  • 1
  • 9
  • 24
4
votes
2 answers

gcc 4.7 and recursive constexpr functions

I'm playing a little bit with constexpr recursion and try to see how it is compiled and I don't understand under which circumstances gcc choose to calculate the recursion at compile time or at run time. I'm using the following factorial calculation…
4
votes
2 answers

#include causes lots of '' has not been declared errors

I'm trying to compile my 'graphics' engine, but am having a problem after including (Debian Testing 64bit). Here's the error: jarrett@jarrett-g74s:~/projects/icebreak/ice_engine$ scons scons: Reading SConscript files ... scons: done reading…
Jarrett
  • 1,767
  • 25
  • 47
4
votes
1 answer

const QList warnings = QList() << 0; segfaults with gcc 4.7.2

So the code mentioned on the topic line causes segmentation fault with Qt 4.8.3 & gcc 4.7.2 This is at outside of any classes/structs at .cpp-file and works with gcc 4.4 const QList warnings = QList() << 0 << 3 << 7; Traces gives these…
turska
  • 61
  • 6
3
votes
1 answer

how to install older version of gcc -3 or gcc-4 in ubuntu 20

I'm trying to install an older version of gcc-4enter code here for my ubuntu Make a build directory ( mkdir gcc-build && cd gcc-build) Download the source file: wget http://www.netgull.com/gcc/releases/gcc-4.8.0/gcc-4.8.0.tar.bz2 (adjust this…
Jerald Jacob
  • 77
  • 2
  • 10
3
votes
1 answer

How to make gcc 4.7 warn about use of the infamous gets() function?

I saw yet another question about C where the code was using gets(), and I commented with the usual warning about never using gets() except when you want to demonstrate how to break security. This time, I decided to check if my compiler issued a…
Tom Zych
  • 13,329
  • 9
  • 36
  • 53
3
votes
1 answer

Strange memory behavior with std map and shared_ptr

The code below provokes a strange memory behavior on my Debian machine. Even after maps are cleared, htop shows that the program still uses a lot of memory, which makes me think there is a memory leak. The strange fact is that it only appears under…
Mike
  • 607
  • 7
  • 8
3
votes
2 answers

How to use isnan as a predicate function to std::find_if (c++11)

I have a piece of code that is operating on a std::vector cats and is doing something like this: std::find_if(cats.begin(), cats.end(), std::isnan); this compiles under gcc before 4.3 but no longer compiles with gcc 4.7.2. I get an…
Palace Chan
  • 8,845
  • 11
  • 41
  • 93
3
votes
0 answers

GCC 4.6.3 vs 4.7.3: Difference in printing greg_t for x86_64

I am attempting to fix a build error. The offending line of code is as follows: fprintf(crashLog, "RIP: %lX\n", context->uc_mcontext.gregs[REG_RIP]); And hence: gregs is of type gregset_t gregs[i] is of type greg_t Now this code (which is for…
Damien
  • 785
  • 3
  • 8
  • 18
3
votes
2 answers

What is the issue with Ubuntu (12.10) and GCC 4.7/4.8?

Since several versions of GCC and Ubuntu I am experiencing annoying issues with paths and naming of several header and object files that are necessary for the installation of GCC. Description: After installing ubuntu (e.g. in my case 12.04) and…
sema
  • 532
  • 7
  • 23
3
votes
0 answers

Linker exits when linking glew statically

I'm having an issue when linking glew-1.9.0 statically with my project. collect2.exe: error: ld returned 5 exit status For the smallest test possible, just creating an OpenGL context (through SFML 2) and initializing glew, the linker exits with no…
Kian
  • 1,654
  • 1
  • 14
  • 22
3
votes
1 answer

Compile error when using template aliases, inheriting template and using a "template parent's" types

I have a data container which has following requirements: Be fast: Hence templates and not normal inheritance Use different implementations Be able to extend those implementations with more methods Data is specified via template argument and needs…
UrOni
  • 431
  • 4
  • 9
3
votes
1 answer

Clang 3.2 build broken after building gcc 4.7

So I know Clang depends (most of the time) on Gnu's libstdc++3, but after building gcc 4.7.0 (cuz' of awesome!) I seem to have run into a problem, all the paths for clang are wrong. Do I need to clean my build directory and start from scratch for…
alexmherrmann
  • 1,055
  • 2
  • 9
  • 17
2
votes
3 answers

GCC 4.7, including

I've just compiled GCC 4.7 to work with stdatomic.h, but I can't seem to -I it. stdatomic.h seems to live in /usr/include/c++/4.4.3, but then the linker tells me it needs a bunch of other files in dirs nearby. If I -I all of them, I still get the…
Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217
1 2
3
9 10