当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
六、对比Vector、ArrayList、LinkedList有何区别?(设计、性能、安全)
设备树(devicetree)-dts语法
ZEMAX | 如何创建简单的非序列系统
002_旭日X3派初探:TogetherROS安装
神经网络基础
SolidWorks 操作视频 | 流体分析结果演示
g++参数说明
内网渗透信息收集
微信小程序 自定义tabBar
A.1#【内存管理】——1.1.2 zone: struct zone
ZEMAX | 在OpticStudio中建立扩增实境(VR)头戴式显示器
Makefile自动推导的简单例程
Typora
自我监督学习和BERT模型
损失函数(第五周)
Delightful Nuxt3 Tutorial (2): Build a Blog Quickly and Easily
VS2022 encapsulation under Windows dynamic library and dynamic library calls
ucos任务调度原理
5. What is the difference between int and Integer?
ZEMAX | 探索 OpticStudio中的序列模式









