In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Generate a shared library from a linked list written by yourself
1, compilation
2. Set the library name:
The name format of the library: lib + XXX + version number .so (library name is XXX)
-shared generates a shared file library-fpic dynamic link
3, put the header file and .so file in the system directory
(using shared libraries, change the previous # include "list.h" to # include
< list.h >Delete the list.* in this folder and run it successfully)
4. Link library: gcc main.c-o main-lList
Note: if .h is not placed under the system path, use the-I path
If .so is not placed under the system path, use the-L path
If the shared library is not placed under the system path, how to solve the problem that cannot be found at run time
1) first, move .h and .so to a non-system path and link to generate an executable file that cannot be found at run time:
2) solution 1: modify the shared library configuration file / etc/ld.so.conf to add the path of .so to the configuration file; execute: ldconfig
solution 2: configure the environment variable LD_LIBRARY_PATH
(however, this method is temporary and only valid for the current user this login)
You can also view the value of the environment variable: $LD_LIBRARY_PATH
Then modify it, LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/mnt/hgfs/share/
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.