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
0
votes
2 answers

This code snippet is working the first while loop but is not executing the one after it

This code is supposed to skip a line of file and write everything else in a different file, delete the original one, and rename the different one to the one deleted. Whats wrong with this code is its not working after the first file ,i.e., the…
user13695064
0
votes
1 answer

Unable to access variable name corresponding to register RTX in gcc

Is it possible to access the variable name if we have an RTX which is a reg that corresponds to a variable declared by the user in GCC? I have found the macro REG_USERVAR_P (RTX) in rtl.h which returns the boolean "1 if RTX is a reg that…
0
votes
2 answers

/x86_64-linux-gnu/Scrt1.o: In function `_start': (.text+0x20): undefined reference to `main'

..when I run: gcc -o server -lpthread server.c the error happened. and: gcc -o client -lpthread client.c the same error again. I am writing a TCP-based chatroom program。 There is server.c: #include #include #include…
0
votes
1 answer

Compiler error trying to call base-case overloads from variadic function template

I'm trying to write a variadic template function that calls single-argument overloads as base cases. The base cases cannot be declared before my variadic because they involve types defined elsewhere. I need this to work with gcc-4.7.2. I've got…
John
  • 7,301
  • 2
  • 16
  • 23
0
votes
1 answer

"undefined reference to `boost::program_options::...'" when linking CXX executable in the doppia ground_estimation application

I'm trying to compile the CPU code of doppia (step 2: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo . && make). The dependency I'm having trouble with is Boost. Doppia couldn't find Boost in the beginning (No Boost libraries were found.) and installing…
Simon
  • 1
  • 2
  • 4
0
votes
0 answers

Constant casting in C++ gives 2 different values for the same address

int main() { const int i = 9; const int* p = &i; int *c = const_cast(p); *c = 3; cout<<"i = "<
Tarek
  • 31
  • 1
  • 4
0
votes
2 answers

How to pass a variable list of parameters to vprintf in a portable way?

I have a code that receives binary array of 32-bit values from a device and prints them with vsprintf, like this: void print_stuff(int32_t *p, const char *format) { vprintf( format, (va_list)p); } (this is simplified; it's ensured that the…
ddbug
  • 1,392
  • 1
  • 11
  • 25
0
votes
0 answers

How does compiler optimisation done with respect to this code?

I am getting two different answers in two different compiler . #include #define square(a) a*a main() { int a=3; printf("%d ",square(a++)); printf("%d ",square(a--)); } In gcc 4.x versions output is 9 and 25 In newer gcc 12 and…
Anjaneyulu
  • 434
  • 5
  • 21
0
votes
1 answer

How to #define call(Double X) to func2(double X)

I have some 200 files where we have used "abs" function to find absolute for ints , longs and doubles . For doubles the right function call is fabs and not abs . Now in C++11 that is handled as abs supports for doubles as well in c++11 , but we…
MAG
  • 2,841
  • 6
  • 27
  • 47
0
votes
1 answer

unsure about asm-offsets.c compilation in U-boot source

I could see lib/asm-offset.c file in u-boot(2014.07) source(another file at arch/arm/lib/asm-offsets.c), main function is defined in these files. Initially I got doubht who will call this main function, I checked Makefile, but no entry for this file…
user3693586
  • 1,227
  • 5
  • 18
  • 40
0
votes
1 answer

how value assigned to __image_copy_start in U-boot

As per my understanding below command is loading value of "__image_copy_start" to r1 register. ldr r1, =__image_copy_start I am trying to understand how value is assigned to "__image_copy_start". I couldn't find any assignment statement…
user3693586
  • 1,227
  • 5
  • 18
  • 40
0
votes
1 answer

GCC local installation Ubuntu

I have access to public machine which don't provide sudo access. How can I install latest g++ in a local folder in Ubuntu and use it while compiling and running C++ programs? I tried this solution (Install gcc on linux with no root privilege) but…
0
votes
1 answer

gcc 4.7.1 C++ static local initialization hangs

... and resumes if a thread is kicked with a signal. No core dump or stack trace available. Has anyone ever seen this behavior before and been able to annotate to any known gcc/glibc bugs? Seen it once on a RHEL 5.5 Westmere and once on a RHEL 6.5…
bobah
  • 18,364
  • 2
  • 37
  • 70
0
votes
0 answers

Building boost 1.57 with gcc4.7.1

I'm trying to build Boost 1.57 with GCC 4.7.1 bundled with CodeBlocks on Win7 64b. I did this : mkdir c:\boost\build cd c:\boost\tools\build\v2 bootstrap.bat gcc b2 install --prefix=C:\boost\build set PATH=%PATH%;C:\boost\build\bin cd c:\boost b2…
Jykten
  • 1
  • 1
0
votes
1 answer

gcc-4.7.2 installation fails on Rhel 6

I tried to install gcc 4.7.2 on RHEL 6. I have downloaded tar.gz archive from here, and performed following steps. tar zxvf gcc-4.7.2.tar.gz cd gcc-4.7.2 ./configure --prefix=/usr/local/gcc-4.7.2/ --mandir=/usr/share/man --infodir=/usr/share/info…
Alvin
  • 940
  • 2
  • 13
  • 27