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
10
votes
4 answers

GCC: -static and -pie are incompatible for x86?

I'm recompiling some executable for Android 5.0 as it requires executables to be PIE. I was able to recompile it for ARM with just adding some arguments while configuring (with standalone toolchain): export CFLAGS="-I/softdev/arm-libs/include…
4ntoine
  • 19,816
  • 21
  • 96
  • 220
10
votes
3 answers

C++11 clocks: g++ steady_clock::is_steady == false?

So accurate timing is important to me, and I was investigating the 3 types of clocks specified in C++ 11, namely system_clock, steady_clock, and high_resolution_clock. My initial concern was testing if there is any difference in call overhead to…
Nicu Stiurca
  • 8,747
  • 8
  • 40
  • 48
10
votes
2 answers

Missing ___emutls_get_address with gcc-4.7 and openMP

I am trying to compile a program using a self-compiled GCC-4.7.1 on Mac OS 10.8.2. The program uses openMP and the compilation succeeds; however, when I try to run the program, the dynamic linker complains with dyld: lazy symbol binding failed:…
Marco Lombardi
  • 545
  • 4
  • 18
8
votes
3 answers

Does std::vector satisfy the container requirements for Boost.Interprocess allocators?

In boost::interprocess documentation it is said as requirement for containers to be stored in shared memory: STL containers may not assume that memory allocated with an allocator can be deallocated with other allocators of the same type. All…
Gabor Marton
  • 2,039
  • 2
  • 22
  • 33
8
votes
1 answer

C++11 Initializing class static const array

Here's what I am trying. MinGW g++ 4.7.0. #include #include class Fruit { public: enum Value { APPLE, ORANGE, BANANA, NONE }; static const Value VALUES[4] = { APPLE, ORANGE, BANANA, NONE }; Fruit (Value v = NONE) :…
user1594322
  • 2,008
  • 3
  • 19
  • 16
6
votes
2 answers

Is boost::uuids::random_generator thread safe?

Consider this function compiling with g++ -std=c++11 (GCC 4.7.2): boost::uuids::uuid getID() { static boost::uuids::random_generator generator; return generator(); } Is it safe to call getID from multiple threads? As it is mentioned here…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
6
votes
1 answer

gcc 4.7.3 and gdb 7.6 on Mac - strange stepping problems

I recently installed GCC 4.7.3 and GDB 7.6 on my OS X 10.7 system via MacPorts to be able to compile C++11 code. I cannot use Apple's selfmade clang++ and gdb since it doesn't allow me to debug standard template library code properly (for example,…
Entropia
  • 154
  • 9
6
votes
1 answer

gcc nullptr issue

I am porting existing code to compile under gcc 4.7.2 and have run into a strange issue with nullptr. I have managed to boil it down to a simple test case: #include const char* g_marker = "Original value"; void SetMarker( const char* s…
6
votes
1 answer

Why is scanf("%hhu", char*) overwriting other variables when they are local?

The title says it all. I'm using GCC 4.7.1 (bundled with CodeBlocks) and I faced a strange issue. Consider this: int main() { unsigned char a = 0, b = 0, c = 0; scanf("%hhu", &a); printf("a = %hhu, b = %hhu, c = %hhu\n", a, b, c); …
Daniel Castro
  • 1,290
  • 2
  • 11
  • 22
5
votes
1 answer

how to write a c function that can take both dynamic/statically allocated 2D array?

I have a function that supposed to take 2D array as an argument, my code looks like this -- #include #include void func(double**, int); int main() { double m[3][3] = {{1, 1, 1}, {2, 2, 2}, {3, 3, 3}}; func(m,…
ramgorur
  • 2,104
  • 4
  • 26
  • 39
5
votes
2 answers

Super weird segfault with gcc 4.7 -- Bug?

Here is a piece of code that I've been trying to compile: #include #define N 3 struct Data { int A[N][N]; int B[N]; }; int foo(int uloc, const int A[N][N], const int B[N]) { for(unsigned int j = 0; j < N; j++) { for(…
kalj
  • 1,432
  • 2
  • 13
  • 30
5
votes
2 answers

Is std::async broken in gcc 4.7 on linux?

I'm testing std::async in isolation before using it in real code, to verify that it works correctly on my platform (which is ubuntu 12.10 64-bit). It works (somewhat rarely) and usually just hangs. If it works for you, don't jump to conclusions. Try…
doug65536
  • 6,562
  • 3
  • 43
  • 53
5
votes
1 answer

linking error: undefined reference to icu_50::UnicodeString::UnicodeString()

I am trying to compile my project where I've declared as class members some: icu::UnicodeString label; icu::UnicodeString tags; icu::UnicodeString domain; icu::UnicodeString data; After having included (yes it is found) #include…
Ælex
  • 14,432
  • 20
  • 88
  • 129
5
votes
1 answer

C++ error: was not declared in this scope with private after public

Attempting to modify the code from this page. Here's the problem code: #include #include template class const_reverse_wrapper { public: const_reverse_wrapper (const T& cont) : container_(cont) { } …
user1594322
  • 2,008
  • 3
  • 19
  • 16
5
votes
2 answers

GCC-4.7 Compilation error

When I add the last line from this snippet to my program code: typedef std::set JobSet; typedef boost::shared_ptr JobSetPtr; JobSetPtr jobs_; jobs_->insert ( job ); // line 60 I get this error: g++-4.7 -o…
itun
  • 3,439
  • 12
  • 51
  • 75
1
2
3
9 10