当前位置:网站首页>g++ parameter description
g++ parameter description
2022-08-03 06:11:00 【Shiyu】
-I (capital i)
Function: Find header files.The search order is -I{path}->/usr/include->usr/local/include
g++ main.cpp -o main -I /home/linyu/include/
-l (lowercase l)
Role: Specify the library to be linked by the program, followed by the library name.The search order is -I{path}->/usr/lib->usr/local/lib
Example: The library name of the math library is m, and his library file name is libm.so.Note that the dynamic library is linked first, followed by the static library.
g++ main.cpp -o main -lzmq
-L(uppercase L)
Libraries placed in /lib, /usr/lib and /usr/local/lib can be linked directly with the -l (lowercase l) parameter, but if the library files are not placed in these three directories, andIf it is placed in another directory, then if we only use the -l parameter, the link will still go wrong. For example, if we put libm.so in the /aaa/bbb/ccc directory, the link parameter is -L /aaa/bbb/ccc -lm
g++ main.cpp -o main -L /aaa/bbb/ccc -lm
-g
Function: to generate debugging information, the program can be debugged by the debugger.
g++ -g main.cpp -o main
边栏推荐
- enum和enum class的区别
- KASLR-内核地址空间布局随机化
- 自监督论文阅读笔记 Self-supervised Label Augmentation via Input Transformations
- Phase Vocoder的补充完善,Matlab音频变速不变调、变调不变速
- 二、Exception和Error有什么区别?
- 进程间通信IPC - 信号量
- 自监督论文阅读笔记 Ship Detection in Sentinel 2 Multi-Spectral Images with Self-Supervised Learning
- 深度学习基本概念
- Gradle插件与代理服务器导致Sync Project失败的问题
- 关于梯度下降法的一些优化方法
猜你喜欢
随机推荐
九、请介绍类加载过程,什么是双亲委派模型?
内网渗透信息收集
队列方法接收串口的数据
Delightful Nuxt3 Tutorial (2): Build a Blog Quickly and Easily
ZEMAX | 如何使用ZOS-API创建自定义操作数
Makefile自动推导的简单例程
A.1#【内存管理】——1.1.3 page: struct page
寄存器常见指令
001_旭日X3派初探:开箱测试
003_旭日X3派初探:利用无线串口通信控制舵机
电子元器件和电子元件的区别有那些?
AI智能剪辑,仅需2秒一键提取精彩片段
ZEMAX | 在OpticStudio中建立扩增实境(VR)头戴式显示器
影响PoE供电传输距离的除了网线还有啥?
cobalt strike 的基础使用
ZEMAX | 如何围绕空间中的任何点旋转任何元素
【第三周】ResNet+ResNeXt
5. What is the difference between int and Integer?
【DC-5 Range Penetration】
自我监督学习和BERT模型









