Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install dynamic connection in Fedora gcc

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install Fedora gcc dynamic connection, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The program I originally wrote was compiled smoothly in gcc 4.2.1, but I made an error when I tested it in F9 today: test.cpp:38: error: 'memcpy' was not declared in this scope

The official Fedora gcc installation has instructions for this situation: http://gcc.gnu.org/gcc-4.3/porting_to.html

In order to speed up the compilation, the Fedora gcc installation reduces the check for header files, so you have to include all relevant header files manually. This ensures that programmers are aware of which header files they need when writing code, rather than leaving it to the compiler to handle. But at the same time, it also brings a lot of trouble, many of the previously written code can not be compiled in Fedora gcc 4.3.

It was perfectly normal for me to compile a dynamic link library with Fedora gcc 4.2.1 in my Fedora gcc installation (in the VM virtual machine), but failed with Fedora gcc 4.3 compilation in F9 (AMD64 Dou):

/ 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: could not read symbols: Bad value

I don't know if this is a problem with Fedora gcc 4.3 or a dual-core 64 system. I had to install a lower version of Fedora gcc and downloaded the source package of Fedora gcc 4.2.4, but I didn't expect another error in compilation:

/ usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: there is no such file or directory

After a long time of google, I finally found the answer, missing: glibc-devel-32bit, but I couldn't find a glibc-devel-32bit that matched my system glibc-devel. I could only find a 2.5 rpm package, so I had to use the-nodeps option during installation.

Install the newly compiled Fedora gcc, reset the PATH, and compile the previous program again, and the result is still the same, which does seem to be a problem with the 64-bit system.

The above is all the contents of the article "how to install dynamic connections in Fedora gcc". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report