Questions tagged [gcc4]

Version 4.x of GCC (GNU Compiler Collection). It's the de facto standard C compiler on Linux and supports many other languages and platforms as well.

Version 4.0.0 was released on 2005-04-20. Version 4.9.4 was released on 2016-08-03.

See also:

184 questions
5
votes
2 answers

Error compiling the compiler GCC

I know, it's an irony to compile a compiler. But I need a specific version of this compiler, and the CentOS 5.x repositories have not the most recent versions of GCC. The version what i need is 4.3.2 but I only have 4.1.1. I followed this tutorial…
Mr_LinDowsMac
  • 2,644
  • 9
  • 56
  • 75
5
votes
2 answers

Can I compile universal code using Macports' GCC?

Since Apple do not support GCC 4.6 or GCC 4.7, I just switched to MacPorts' build of GCC 4.6/4.7. However, I had a problem to build my code in "Universal" architecture. Traditionally, I'd do g++ -arch i386 -arch x86_64 ... to compile my binary for…
xing_yu
  • 393
  • 1
  • 10
5
votes
1 answer

dSYM files for release builds

Do .dSYM resources contain any other information except DWARF information? I have created a release build of an app. Now if I run dwarfdump on it, it says the executable has no DWARF info (says it's "empty"), which is what I would expect. But if I…
341008
  • 9,862
  • 11
  • 52
  • 84
5
votes
3 answers

Forcing GCC 4.x to treat -Wreturn-type as an error without enabling -Werror?

Suppose we have the following code: #if !defined(__cplusplus) # error This file should be compiled as C++ #endif #include #include //#define USE_CXX_CLASS #ifdef USE_CXX_CLASS class SomeClass { public: SomeClass() {} …
bgoodr
  • 2,744
  • 1
  • 30
  • 51
5
votes
1 answer

Problem on Mac : "Can't find a register in class BREG while reloading asm"

I tried to port some code onto Mac OS X. The program uses the "ttmath" library, a header big-num header library. This library works fine on both windows and linux, but when I try to compile and run it on a Mac, the following error message always…
Claire Huang
  • 961
  • 1
  • 18
  • 30
5
votes
1 answer

How to get GDB to stop on an assertion failure?

I'm working on a project which includes many assertions (as it should). Problem is, I can't get GDB to break on an assertion failure; it just prints a nice assertion failure message and aborts the program. Based on earlier posts I've added, to no…
Dave Nadler
  • 316
  • 4
  • 15
5
votes
1 answer

`pragma pack(push, 1)` crashes in GCC 4.4.7. Possible compiler bug?

I'm encountering a bug that has me stumped. I've narrowed it down to an issue with the pragma pack command in GCC (specifically RHEL Linux, GCC v.4.4.7) that can be recreated in the small sample case I've shown below. It looks like GCC is…
Scott 'scm6079'
  • 1,517
  • 13
  • 25
5
votes
2 answers

dynamic_cast fails - depending on OS Version

I have a dynamic cast which is failing. The class layout is like this: class A1 { public: virtual int foo1()=0; }; class A2 { public: virtual int foo2(); }; class A3 { public: virtual int foo3(); }; class B : public A1, public A2,…
Heiner
  • 165
  • 1
  • 11
5
votes
2 answers

Cross-compile Autotools-based Libraries for Official iPhone SDK

Background I am writing a program that targets several different phones, including the iPhone. The program depends on several thirdparty libraries. I am having difficulty cross-compiling these thirdparty libraries for the iPhone and iPhone…
Michael Aaron Safyan
  • 93,612
  • 16
  • 138
  • 200
4
votes
2 answers

Multiple copy constructors specified

With Visual C++ 2010, I have a class like this: class MyClass{ public: MyClass(){} MyClass(MyClass &){/*...*/} //A MyClass(const MyClass &){/*...*/} //B template MyClass(T &&t){ static_assert( …
Earth Engine
  • 10,048
  • 5
  • 48
  • 78
4
votes
3 answers

Linking multiple C source files

I'm on gentoo linux with GCC 4.4.5 installed. I can compile and link such program without any errors using gcc main.c -o main, and the command ./main returns result correctly. [main.c] #include #include int main(void) { …
machinarium
  • 631
  • 6
  • 17
4
votes
1 answer

Boost multi_index_container, get index by tag results in compiler error

So, I'm trying to dabble with the multi_index_container and am having a rather strange compiler error, first here is the simplest example to demonstrate my problem (I'm probably missing something stupidly simple)... #include…
Nim
  • 33,299
  • 2
  • 62
  • 101
4
votes
2 answers

Forcing VS2008 to issue a GCC warning similar to "warning: comparison between signed and unsigned integer expressions"

Along the same lines as to what was described in conversion to ‘size_t’ from ‘int’ may change the sign of the result - GCC , C, I would instead like to insure that the warning I receive under GCC 4.2.1 is also flagged under VS2008 SP1 under both…
bgoodr
  • 2,744
  • 1
  • 30
  • 51
4
votes
1 answer

Interface reference to local implementation

Please consider the following code: struct A { virtual ~A() {} virtual int go() = 0; }; struct B : public A { int go() { return 1; } }; struct C : public B { int go() { return 2; } }; int main() { B b; B &b_ref = b; return…
Gui Prá
  • 5,559
  • 4
  • 34
  • 59
4
votes
1 answer

gfortran multiple definition of main

I'm having trouble with compiling a piece of code I have been given for my research. It consists of one component written in C++ and the other in FORTRAN. I think the problem is to do with my gcc version. The first file for example is a C++ file…
user2982871
  • 43
  • 1
  • 3
1 2
3
12 13