How to define several include path in Makefile(如何在 Makefile 中定义多个包含路径)
问题描述
New to C++; Basic understanding of includes, libraries and the compile process. Did a few simple makefiles yet.
My current project involves using an informix DB api and i need to include header files in more than one nonstandard dirs. How to write that ? Havent found anything on the net, probably because i did not use good search terms
This is one way what i tried (not working). Just to show the makefile
LIB=-L/usr/informix/lib/c++
INC=-I/usr/informix/incl/c++ /opt/informix/incl/public
default: main
main: test.cpp
gcc -Wall $(LIB) $(INC) -c test.cpp
#gcc -Wall $(LIB) $(INC) -I/opt/informix/incl/public -c test.cpp
clean:
rm -r test.o make.out
You have to prepend every directory with -I:
INC=-I/usr/informix/incl/c++ -I/opt/informix/incl/public
这篇关于如何在 Makefile 中定义多个包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Makefile 中定义多个包含路径
基础教程推荐
- 全面了解C语言 static 关键字 2023-03-26
- C语言编程C++旋转字符操作串示例详解 2022-11-20
- C语言 详解字符串基础 2023-03-27
- [c语言-函数]不定量参数 2023-09-08
- [C语言]二叉搜索树 2023-09-07
- centos 7 vscode cmake 编译c++工程 2023-09-17
- 带你深度走入C语言取整以及4种函数 2022-09-17
- C++实现ETW进行进程变动监控详解 2023-05-15
- C语言实现宾馆管理系统课程设计 2023-03-13
- C++实战之二进制数据处理与封装 2023-05-29
