当前位置:网站首页>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
- FPGA: Basic Getting Started Button Controlling LED Lights
- SMB + SMB2: Accessing shares return an error after prolonged idle period
- 2022 Huashu Cup Mathematical Modeling Ideas Analysis and Exchange
- What is the function of the regular expression replaceFirst() method?
- 攻防世界-PWN-new_easypwn
- 19.3 restart the Oracle environment
- 高质量 DeFi 应用构建指南,助力开发者玩转 DeFi Summer
- Huawei's lightweight neural network architecture GhostNet has been upgraded again, and G-GhostNet (IJCV22) has shown its talents on the GPU
- Score interview (1)----related to business
猜你喜欢

Jenkins使用手册(2) —— 软件配置

语音社交软件开发——充分发挥其价值

Getting started with Polkadot parachain development, this article is enough

首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析

Our Web3 Entrepreneurship Project, Yellow

【综合类型第 35 篇】程序员的七夕浪漫时刻

Pycharm 常用外部工具

【 temperature warning program DE development 】 event driven model instance

多线程(进阶) - 2.5w字总结

Create a Dapp, why choose Polkadot?
随机推荐
Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
three.js debugging tool dat.gui use
SQL Outer Join Intersection, Union, Difference Query
NowCoderTOP35-40 - continuous update ing
用户考试分数大于单科科目平均分的查询
Where is your most secretive personality?
Score interview (1)----related to business
FPGA: Use of the development environment Vivado
牛刀小试基本语法,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang基本语法和变量的使用EP02
【Unity】【UGUI】【在屏幕上显示文本】
IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
力扣(LeetCode)216. 组合总和 III(2022.08.04)
创建一个 Dapp,为什么要选择波卡?
2022 Hangzhou Electric Power Multi-School Session 6 1008.Shinobu Loves Segment Tree Regular Questions
第六章:activiti流程分流判断之排它网关和并行网关
FPGA: Basic Getting Started Button Controlling LED Lights
Egg framework usage (1)
上位机开发C#语言:模拟STC串口助手接收单片机发送数据
单片机:温度控制DS18B20
百年北欧奢华家电品牌ASKO智能三温区酒柜臻献七夕,共品珍馐爱意