• AVR Freaks

Hot!Creating Header file in project

Super Member
  • Total Posts : 224
  • Reward points : 0
  • Joined: 2017/05/22 22:22:08
  • Location: 0
  • Status: offline
2019/09/15 02:05:44 (permalink)

Creating Header file in project

Please refer the both images,
When I create an header file in the project means,there are two options to save the header file.
in which folder,have to save the header file.
Is it make some errors,while saving header file wrongly..?
I'm using MPLAB X IDE 5.15 and XC8 softwares...

Attached Image(s)


1 Reply Related Threads

    Super Member
    • Total Posts : 3670
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: Creating Header file in project 2019/09/15 03:24:17 (permalink)
    +3 (3)
    There is nothing wrong with storing header files in either of those directories,
    or any other directory you may choose.
    In C programming language, header files may be stored in any directory.
    However, if a header file is not stored in the obvious place,
    then You will have to tell the compiler where to search for header files.
    There is basically two different ways: Specifying a directory search list in MPLAB IDE,
    or specifying absolute or relative directory path in every #include line where it may be needed.
    In a large project with many files in multiple directories, this may become complicated, and may need planning and clear thinking.
    In a MPLAB X project, the default directory for source and header files, is the ...X directory, eg.:
    the simplest solution for a small project, is to store all source and header files in the same directory.
    Directories you have, may seem to come from a MPLAB 8 project that have been converted to MPLAB X,
    thus the two directories with some files each.
    Note: Copying a header file, such that the same file is available in different directories,
    may solve a immediate problem, but when one file is edited and the other is not, then this will cause even more confusing problems later.
    Jump to:
    © 2020 APG vNext Commercial Version 4.5