当前位置:网站首页>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)边栏推荐
- [Android]如何使用RecycleView in Kotlin project
- High-quality DeFi application building guide to help developers enjoy DeFi Summer
- 百年北欧奢华家电品牌ASKO智能三温区酒柜臻献七夕,共品珍馐爱意
- A small test of basic grammar, Go lang1.18 introductory refining tutorial, from Bai Ding to Hongru, basic grammar of go lang and the use of variables EP02
- 2022 Hangzhou Electric Power Multi-School Session 6 1008.Shinobu Loves Segment Tree Regular Questions
- 公众号如何运维?公众号运维专业团队
- Why are RELTABLESPACE values 0 for many tables displayed in sys_class?
- 电气工程的标准是什么
- Handwriting Currying - toString Comprehension
- 第五章:activiti流程分流判断,判断走不同的任务节点
猜你喜欢

three.js调试工具dat.gui使用
![[强网杯2022]WP-UM](/img/3d/caeab05ddca278af274dbf6e2f8ba1.png)
[强网杯2022]WP-UM

RT - Thread record (a, RT, RT Thread version - Thread Studio development environment and cooperate CubeMX quick-and-dirty)

还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!

电竞、便捷、高效、安全,盘点OriginOS功能的关键词

three物体围绕一周呈球形排列

2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享

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

Microservice Technology Stack

2022 Huashu Cup Mathematical Modeling Question A Optimization Design Ideas for Ring Oscillators Code Sharing
随机推荐
第四章:activiti RuntimeService设置获和取流程变量,及与taskService的区别,开始和完成任务时设置流程变量[通俗易懂]
High-quality DeFi application building guide to help developers enjoy DeFi Summer
How does the official account operate and maintain?Public account operation and maintenance professional team
第四章:redis 数组结构的set和一些通用命令「建议收藏」
The fuse: OAuth 2.0 four authorized login methods must read
导火索:OAuth 2.0四种授权登录方式必读
IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
IDEA performs the Test operation, resulting in duplicate data when data is inserted
告白数字化转型时代:麦聪软件以最简单的方式让企业把数据用起来
DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
Microcontroller: temperature control DS18B20
攻防世界-PWN-new_easypwn
How to choose coins and determine the corresponding strategy research
What is the function of the regular expression replaceFirst() method?
NowCoderTOP35-40 - continuous update ing
[Android]如何使用RecycleView in Kotlin project
RT - Thread record (a, RT, RT Thread version - Thread Studio development environment and cooperate CubeMX quick-and-dirty)
企业的数字化转型到底是否可以买来?
Pycharm 常用外部工具
uniapp connect ibeacon