当前位置:网站首页>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 operation mangoDb
- Brief Analysis of WSGI Protocol
- 第九章:activit内置用户组设计与组任务分配和IdentityService接口的使用
- static linking and dynamic linking
- 如何选币与确定对应策略研究
- Development common manual link sharing
- 2022 Huashu Cup Mathematical Modeling Question A Optimization Design Ideas for Ring Oscillators Code Sharing
- Egg framework usage (1)
- 首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析
- 【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
猜你喜欢

5. Deploy the web project to the cloud server
![[强网杯2022]WP-UM](/img/3d/caeab05ddca278af274dbf6e2f8ba1.png)
[强网杯2022]WP-UM

产品太多了,如何实现一次登录多产品互通?

Our Web3 Entrepreneurship Project, Yellow

Egg framework usage (1)

Data Middle Office Construction (10): Data Security Management

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

The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!

创建一个 Dapp,为什么要选择波卡?
随机推荐
气象数据数据处理实例——matlab字符串切割匹配与R语言日期匹配(数据拼接)
第五章:多线程通信—wait和notify
[Strong Net Cup 2022] WP-UM
皕杰报表的下拉框联动
The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
【Unity】【UGUI】【在屏幕上显示文本】
RT-Thread记录(一、RT-Thread 版本、RT-Thread Studio开发环境 及 配合CubeMX开发快速上手)
STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析
SD NAND Flash简介!
The host computer develops C# language: simulates the STC serial port assistant to receive the data sent by the microcontroller
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
Go编译原理系列6(类型检查)
[Translation] Chaos Net + SkyWalking: Better observability for chaos engineering
Wei Dongshan Digital Photo Frame Project Learning (6) Transplantation of tslib
Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way
阿里全新推出:微服务突击手册,把所有操作都写出来了PDF
Score interview (1)----related to business
创建一个 Dapp,为什么要选择波卡?
第四章:activiti流程中,变量的传递和获取流程变量 ,设置和获取多个流程变量,设置和获取局部流程变量「建议收藏」