当前位置:网站首页>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
边栏推荐
猜你喜欢
自监督论文阅读笔记Index Your Position: A Novel Self-Supervised Learning Method for Remote Sensing Images Sema
内网渗透信息收集
ZEMAX | 绘图分辨率结果对光线追迹的影响
自监督论文阅读笔记 DetCo: Unsupervised Contrastive Learning for Object Detection
Delightful Nuxt3 Tutorial (2): Build a Blog Quickly and Easily
代码没写完,哪里有脸睡觉!17 张程序员壁纸推荐
2021-04-30
自监督论文阅读笔记Reading and Writing: Discriminative and Generative Modelingfor Self-Supervised Text Recogn
稳压二极管的工作原理及稳压二极管使用电路图
解决Gradle Download缓慢的百种方法
随机推荐
ucos任务调度原理
快速的将结构体各成员清零
电子元器件和电子元件的区别有那些?
ASP.NET MVC3的伪静态实现
IPC通信 - 管道
东南亚跨境电商
基于南航app直减自动出票
自监督论文阅读笔记SELF-SUPERVISED SPECTRAL MATCHING NETWORK FOR HYPERSPECTRAL TARGET DETECTION
JSP的基本使用
自监督论文阅读笔记 Incremental-DETR:Incremental Few-Shot Object Detection via Self-Supervised Learning
深度学习理论课程第八、九、十章总结
JS--正则表达式
Android学习 | 08.SQLiteOpenHelper
ZEMAX | 如何创建简单的非序列系统
Qemu 搭建Armv8 平台
ARMv8 架构----armv8 类别
MATLAB给多组条形图添加误差棒
Gradle插件与代理服务器导致Sync Project失败的问题
VS2022 encapsulation under Windows dynamic library and dynamic library calls
IPC 通信 - IPC