The default GCC version installed in Fedora9 is 4.3. (Ubuntu8.04 is only 4.2.1.) due to GCC changes, errors may occur when the source code in Fedora9 compiles some software, such as EVA. The program I originally wrote can be compiled smoothly in GCC4.2.1. During the test in Fedora9 today, an error occurred: test. cpp: 38: error: 'memcpy' wasnotdeclaredinthisscopeGC.
The default GCC version installed in Fedora 9 is 4.3. (Ubuntu 8.04 is only 4.2.1) due to GCC changes, errors may occur when compiling some software in source code of Fedora 9, such as EVA. The program I originally wrote can be compiled smoothly in GCC 4.2.1. Today I encountered an error during the test in Fedora 9:
Test. cpp: 38: error: 'memcpy' was not declared in this scope
GCC official instructions for this situation: http://GCC.gnu.org/GCC-4.3/porting_to.html
In order to speed up compilation, GCC reduces the check of the first-class file, so it is necessary to manually include all relevant header files. This ensures that programmers are aware of the header files they need when writing code, rather than being handed over to the compiler for processing. But it also brings a lot of trouble. Many previously written code cannot be compiled in GCC 4.3.
I used GCC 4.2.1 to compile a dynamic link library in f8 (vmvirtual machine), but in F9 (AMD64 Dou), GCC 4.3 compilation failed. The following message is displayed:
/Usr/bin/ld: test. o: relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with-fPIC
Test. o: cocould not read symbols: Bad value
I don't know whether this is a problem with GCC 4.3 or a dual-core 64 system. I had to install another lower version of GCC and download the source code package of GCC 4.2.4. I didn't expect an error during compilation:
/Usr/include/gnu/stubs. h: 7: 27: error: gnu/stubs-32.h: No file or directory
And google for a long time finally found the answer, lack: glibc-devel-32bit, but has been unable to find and my system glibc-devel (2.8) matching glibc-devel-32bit, can only find a 2.5 rpm package, you have to use the-nodeps option during installation.
Install the newly compiled GCC, re-set the PATH, and re-compile the previous program. The results are still the same. It seems that the 64-bit system is indeed a problem. (Author: hohokhosau's Nest)