在编译的不同文件夹中获取.h文件和.c文件? [英] Get .h file and .c file in the different folder compiled?

查看:302
本文介绍了在编译的不同文件夹中获取.h文件和.c文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在include文件夹中有一个名为hello.h的.h文件,lib文件夹中名为hello.c的.c文件,它是hello.h中函数的定义,另一个名为main的文件夹中的.c文件.c调用hello.h中的函数来做某事。如何在GCC编译器下将hello.h,hello.c和main.c文件编译在一起?

解决方案

请参阅我对该问题的评论,然后,这: http://gcc.gnu.org/onlinedocs/ [ ^ ]。



-SA

I have a .h file called hello.h in the include folder,a .c file in lib folder called hello.c which is the definition of functions in hello.h, and a .c file in another folder called main.c which call the functions in hello.h to do something. How can I get hello.h, hello.c and main.c files complied together under the GCC complier?

解决方案

Please see my comment to the question, and then, this: http://gcc.gnu.org/onlinedocs/[^].

—SA


这篇关于在编译的不同文件夹中获取.h文件和.c文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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