当前位置:网站首页>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
边栏推荐
- Gensim如何冻结某些词向量进行增量训练
- One book 1078: sum of fractional sequences
- Organigramme des activités
- 浅谈深度学习中的对抗样本及其生成方法
- 【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
- Open3d learning notes 1 [first glimpse, file reading]
- OpenCV3 6.3 用滤波器进行缩减像素采样
- Global and Chinese market of snow sweepers 2022-2028: Research Report on technology, participants, trends, market size and share
- 【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
- 最长等比子序列
猜你喜欢

It's great to save 10000 pictures of girls

Using super ball embedding to enhance confrontation training

用于类别增量学习的动态可扩展表征 -- DER

11月24号,我们为“满月”庆祝

Carsim-实时仿真的动画同步问题

【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》

用全连接层替代掉卷积 -- RepMLP

图像增强的几个方法以及Matlab代码

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

【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
随机推荐
乐理基础(简述)
利用Transformer来进行目标检测和语义分割
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
open3d环境错误汇总
Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)
Simply test the two different data transmission methods of content length and chunked
力扣每日一题刷题总结:链表篇(持续更新)
【Batch】learning notes
Real world anti sample attack against semantic segmentation
【Random Erasing】《Random Erasing Data Augmentation》
Open3d learning note 3 [sampling and voxelization]
Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
E-R draw clear content
用于类别增量学习的动态可扩展表征 -- DER
Where do you find the materials for those articles that have read 10000?
C语言的库函数
将恶意软件嵌入到神经网络中
我的vim配置文件
C#与MySQL数据库连接
用MLP代替掉Self-Attention