使用命令行选项包括头文件

使用命令行选项包括头文件

本文介绍了使用命令行选项包括头文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从命令行指定额外的头文件(使用GCC 4 / C ++)?



除了#include?

背景:我想在我自己的电脑上编译一个大的代码库。代码通常编译在一个集群中,有一个复杂的构建系统(SoftRelTools任何人?),它是与操作系统交织在一起的,因此几乎不可能安装在别的地方(数百个makefile和shell脚本,硬的到网络驱动器的编码路径)。然而,实际的代码是相当简单的,编译良好,但它缺少很多包括(大多是一个 include< vector> include< math.h> )。我猜,构建系统通常会照顾这一点,但我必须通过代码,手动添加包含,我宁愿避免。

解决方案

我 -include选项。这是您想要的吗?


Is it possible to specify extra header files to include from the command line (using GCC 4 / C++)?

Or is there any other way files can be included except with #include?

Background: I'm trying to compile a large code base on my own PC. The code is usually compiled in a cluster, with a complicated build system (SoftRelTools anybody?), which is intertwined with the operating system, such that it is virtually impossible to install it somewhere else (literally hundreds of makefiles and shell scripts, and hard coded paths to network drives). However, the actual code is fairly straightforward, and compiles fine, BUT it is missing a lot of includes (mostly a la "include <vector>" and "include <math.h>"). I'm guessing the build system takes care of this usually, but I have to go through the code and add the includes manually, which I'd rather avoid.

解决方案

I found the -include option. Does this what you want?

这篇关于使用命令行选项包括头文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 07:46