如何包含文件夹中的所有源文件? [英] How to include all source files from a folder?

查看:61
本文介绍了如何包含文件夹中的所有源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将每个函数放在自己的文件中.

I have put each function in own file.

如何在不手动为每个文件重复 #include 的情况下一次包含所有这些功能?我不在乎函数的顺序.

How do I include all those functions at once without repeating #include for each file manually? I don't care at which order the functions are included.

数百个不同文件中的所有功能都属于同一组.实际上每个文件都有4个功能.

All the functions from hundreds of different files belongs to the same group. Actually each file has 4 functions.

推荐答案

  1. 您将包含函数定义(函数主体)的所有文件添加到您的项目中
  2. 您编写一个一个头文件,其中包含函数声明.
  3. 您需要在其中添加该标头.
  1. You add all the files containing the function definitions (function bodies) to your project
  2. You write one header file that contains a declaration for your functions.
  3. You include that header where needed.

这篇关于如何包含文件夹中的所有源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆