# Makefile + #includes

**URL:** <https://community.unix.com/t/makefile-includes/270141>\
**Category:** Programming\
**Created:** [July 23, 2010, 10:21am UTC](https://community.unix.com/t/makefile-includes/270141 "2010-07-23T10:21:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![panou](https://community.unix.com/letter_avatar/panou/32/5_5575768a8748004e209b776fc1b2916d.png) [@panou](https://community.unix.com/u/panou)\
**Post date:** [July 23, 2010, 10:21am UTC](https://community.unix.com/t/makefile-includes/270141/1 "2010-07-23T10:21:18Z")

</div>

Dear all

I try to write a makefile for my code which have many source files, 1 header file that i make and exist into same folder with other source files and some other header files (by libraries witch i use) that found in other folders.

In my header file i have put all other #includes for residuals headers and by each source file, i call only my header file.

The problem is in first step at compiling source files to object.

When it tries to compile that source file in which exist some new variable type by other libraries, give me an error that no recognizes this type.

How must i write the makefile? Why occur this?

---

<div class="post-metadata">

**Author:** ![Corona688](https://community.unix.com/letter_avatar/corona688/32/5_5575768a8748004e209b776fc1b2916d.png) [@Corona688](https://community.unix.com/u/Corona688)\
**Post date:** [July 23, 2010, 10:30pm UTC](https://community.unix.com/t/makefile-includes/270141/2 "2010-07-23T22:30:02Z")

</div>

My crystal ball is still in for maintenance. Please paste the actual error messages.

---

<div class="post-metadata">

**Author:** ![panou](https://community.unix.com/letter_avatar/panou/32/5_5575768a8748004e209b776fc1b2916d.png) [@panou](https://community.unix.com/u/panou)\
**Post date:** [July 24, 2010, 1:07am UTC](https://community.unix.com/t/makefile-includes/270141/3 "2010-07-24T01:07:26Z")

</div>

when it tries to compile createrunstruct file, it is occur this:

createrunstruct.c: In function �createrunstruct':  
createrunstruct.c:31: error: �idxtype' undeclared (first use in this function)  
createrunstruct.c:31: error: (Each undeclared identifier is reported only once  
createrunstruct.c:31: error: for each function it appears in.)  
make: \*\*\* [createrunstruct.o] Error 1

---

<div class="post-metadata">

**Author:** ![Corona688](https://community.unix.com/letter_avatar/corona688/32/5_5575768a8748004e209b776fc1b2916d.png) [@Corona688](https://community.unix.com/u/Corona688)\
**Post date:** [July 24, 2010, 2:20pm UTC](https://community.unix.com/t/makefile-includes/270141/4 "2010-07-24T14:20:59Z")

</div>

It means what it says: 'idxtype' is undeclared. Either you haven't included the right header, or your use of the type is wrong. Beyond that I can't tell, you'd need to post the source code.
