Gcc in Fedora9-general Linux technology-Linux programming and kernel information. The following is a detailed description. Author: hohokhooxiong's nest
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 gcc 4.2.1. Today, an error occurred during the test in F9:
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, so I had to use it during installation? Nodeps option.
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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.