当前位置:网站首页>Static library and dynamic library
Static library and dynamic library
2022-07-02 08:07:00 【programmercherry】
Linux Under the system Three ways of program operation

Direct operation
g++ main.cpp src/swap.cpp -Iinclude -Wall -std=c++11 -o a.out
./a.out
Link static libraries to generate executables
// Get into src Under the table of contents
cd src
// assembly Generate swap.o file
g++ swap.cpp -c -I../include
// Generate static libraries libswap.a
ar rs libswap.a swap.o
// Go back to the parent directory
cd ..
// link Generate executable files static_main
g++ main.cpp -Iinclude -Lsrc -o static_main
// Run the executable
./static_main
Link dynamic library to generate executable file
// Get into src Under the table of contents
cd src
// Generate target file ,fPIC Create an address independent compiler (pic,position independent code), In order to be able to share among multiple applications .
g++ swap.cpp -I../include -c -fPIC
// Generate dynamic library libswap.so
g++ -shared -o libswap.so swap.o
// The above two steps can be combined into one command g++ swap.cpp -I../include -fPIC -shared -o libswap.so
// Go back to the parent directory
cd ..
// link Generate executable files dynamic_main
g++ main.cpp -Iinclude -Lsrc -lswap -o dynamic_main
// Run the executable
LD_LIBRARY_PATH=src ./dynamic_main
Excellent article : The difference between static library and dynamic library
边栏推荐
- 【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
- JVM instructions
- Network metering - transport layer
- 静态库和动态库
- 针对语义分割的真实世界的对抗样本攻击
- What if the laptop can't search the wireless network signal
- w10升级至W11系统,黑屏但鼠标与桌面快捷方式能用,如何解决
- Fundamentals of music theory (brief introduction)
- Embedding malware into neural networks
- 应对长尾分布的目标检测 -- Balanced Group Softmax
猜你喜欢

用MLP代替掉Self-Attention

MySQL优化

浅谈深度学习中的对抗样本及其生成方法

【MobileNet V3】《Searching for MobileNetV3》

Cvpr19 deep stacked hierarchical multi patch network for image deblurring paper reproduction

Simply test the two different data transmission methods of content length and chunked

Jetson nano installation tensorflow stepping pit record (scipy1.4.1)

【MagNet】《Progressive Semantic Segmentation》

How to wrap qstring strings

简易打包工具的安装与使用
随机推荐
【MobileNet V3】《Searching for MobileNetV3》
Graph Pooling 简析
Hystrix dashboard cannot find hystrix Stream solution
【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
Open3d learning note 5 [rgbd fusion]
[learning notes] matlab self compiled Gaussian smoother +sobel operator derivation
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
How gensim freezes some word vectors for incremental training
针对tqdm和print的顺序问题
A brief analysis of graph pooling
Global and Chinese markets for Salmonella typhi nucleic acid detection kits 2022-2028: Research Report on technology, participants, trends, market size and share
Replace self attention with MLP
(15) Flick custom source
【双目视觉】双目矫正
SQL操作数据库语法
Organigramme des activités
稀疏矩阵存储
【Batch】learning notes
Look for we media materials from four aspects to ensure your creative inspiration
Open3d learning notes 1 [first glimpse, file reading]