当前位置:网站首页>Header file search rules when compiling with GCC
Header file search rules when compiling with GCC
2022-08-05 10:19:00 【small husk】
1, GCC search header file rules
First, gcc will look for the required header files from the current directory, usually user-defined header files.
gcc will search for header files according to the header file path specified by the -I parameter, as follows, the header file path is /usr/openwin/include, and /srv/lib is the dynamic library path.
gcc -I /srv/include -L /srv/lib hello.cgcc finds the required header files from its own environment variables C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, OBJC_INCLUDE_PATH
Find the required header files from the default directory /usr/include /usr/local/include /usr/lib/gcc-lib/i386-li.
If neither can be found, an error will be reported.
2. Specify the header file path in the makefile
#path to the compilerCC= /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc#Specify the header file path, prompting warning compilation,CFLAGS=-Wall -I/home/develop/include#source file pathSRCS=main.c sum.c com.c#dynamic library pathLIBS=-L /usr/lib#Specify the target file, all .c files are renamed to .o files (retain the characters at %, and the rest of the characters should be replaced)OBJS=$(SRCS:%.c=%.o)#Specify the name of the executable fileEXECUTABLE=ssj_flyfish#Compile and generate object files$(EXECUTABLE):$(CC) -o $(EXECUTABLE) $(CFLAGS) $(SRCS) $(LIBS)边栏推荐
- PHP 操作mangoDb
- How to choose coins and determine the corresponding strategy research
- 如何选币与确定对应策略研究
- STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
- 【翻译】混沌网+SkyWalking:为混沌工程提供更好的可观察性
- 电竞、便捷、高效、安全,盘点OriginOS功能的关键词
- Jenkins manual (2) - software configuration
- Microcontroller: temperature control DS18B20
- The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!
- What is SPL?
猜你喜欢

项目成本控制如何帮助项目成功?

First Decentralized Heist?Loss of nearly 200 million US dollars: analysis of the attack on the cross-chain bridge Nomad

阿里顶级架构师多年总结的JVM宝典,哪里不会查哪里!

SQL外连接之交集、并集、差集查询

Microservice Technology Stack

登录功能和退出功能(瑞吉外卖)

FPGA:开发环境Vivado的使用

Complete image segmentation efficiently based on MindSpore and realize Dice!

Egg framework usage (1)

【综合类型第 35 篇】程序员的七夕浪漫时刻
随机推荐
Is digital transformation a business buy-in?
Egg framework usage (1)
【翻译】混沌网+SkyWalking:为混沌工程提供更好的可观察性
第四章:activiti RuntimeService设置获和取流程变量,及与taskService的区别,开始和完成任务时设置流程变量[通俗易懂]
The founder of the DFINITY Foundation talks about the ups and downs of the bear market, and where should DeFi projects go?
three.js debugging tool dat.gui use
Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way
如何选币与确定对应策略研究
第四章:redis 数组结构的set和一些通用命令「建议收藏」
静态链接和动态链接
Our Web3 Entrepreneurship Project, Yellow
Egg framework usage (2)
【综合类型第 35 篇】程序员的七夕浪漫时刻
创建一个 Dapp,为什么要选择波卡?
第五章:多线程通信—wait和notify
一个栈的输入序列为1 2 3 4 5 的出站顺序的理解
Where is your most secretive personality?
Ali's new launch: Microservices Assault Manual, all operations are written out in PDF
NowCoderTOP35-40——持续更新ing
第六章:activiti流程分流判断之排它网关和并行网关