当前位置:网站首页>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.c
gcc 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)
边栏推荐
- Still looking for a network backup resources?Hurry up to collect the following network backup resource search artifact it is worth collecting!
- What are the standards for electrical engineering
- 华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
- Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
- E-sports, convenience, efficiency, security, key words for OriginOS functions
- 牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
- 数据中台建设(十):数据安全管理
- 【综合类型第 35 篇】程序员的七夕浪漫时刻
- Where is your most secretive personality?
- Imitation SBUS fixed with serial data conversion
猜你喜欢
Analysis and practice of antjian webshell dynamic encrypted connection
SQL Outer Join Intersection, Union, Difference Query
技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number
2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享
E-sports, convenience, efficiency, security, key words for OriginOS functions
First Decentralized Heist?Loss of nearly 200 million US dollars: analysis of the attack on the cross-chain bridge Nomad
MySQL事务
【AGC】增长服务1-远程配置示例
Egg framework usage (2)
随机推荐
数据中台建设(十):数据安全管理
上位机开发C#语言:模拟STC串口助手接收单片机发送数据
第七章,activiti个人任务分配,动态指定和监听器指定任务委派人「建议收藏」
leetcode: 529. Minesweeper Game
This notebook of concurrent programming knowledge points strongly recommended by Ali will be a breakthrough for you to get an offer from a big factory
Analysis and practice of antjian webshell dynamic encrypted connection
DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
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
[Office] Collection of Microsoft Office download addresses (offline installation and download of Microsoft's official original version)
hcip BGP enhancement experiment
FPGA: Basic Getting Started Button Controlling LED Lights
SQL Outer Join Intersection, Union, Difference Query
2022华数杯数学建模思路分析交流
[Unity] [UGUI] [Display text on the screen]
阿里顶级架构师多年总结的JVM宝典,哪里不会查哪里!
FPGA: Basic Getting Started LED Lights Blinking
一文道清什么是SPL
单片机:温度控制DS18B20
2022 Hangzhou Electric Power Multi-School Session 6 1008.Shinobu Loves Segment Tree Regular Questions
创建一个 Dapp,为什么要选择波卡?