Hi-Tech 9.83 Compiling multiple C and header files

Author
Laury
Junior Member
  • Total Posts : 95
  • Reward points : 0
  • Joined: 2012/08/27 20:15:19
  • Location: Nashville, TN
  • Status: offline
2012/12/22 16:30:47 (permalink)
0

Hi-Tech 9.83 Compiling multiple C and header files

Hi Group:
Is there a tutorial any where that describes how to split off functions, header files and other processes into separate
C files. I'm trying to clean up some of my projects and need to learn how to do this.
I have found bits and pieces on line for other compiles, none for Hi-Tech.
BTW, the Hi-Tech documentation really sucks for new programmers. I have found a mention
for #ifndef but no real explanation on how to use it.
 
Any help appreciated
Thanks
RonL
 
#1

3 Replies Related Threads

    WaltR
    Super Member
    • Total Posts : 3759
    • Reward points : 0
    • Joined: 2003/11/07 12:38:21
    • Status: offline
    Re:Hi-Tech 9.83 Compiling multiple C and header files 2012/12/22 16:57:54 (permalink)
    0
    For the HiTech compiler it is simply add the files to the project in MPLAB.
     
    For the C language aspect follow the guide lines for what goes into header (.h) verse the code files (.c). Refer to any good C documentation for how to use the comiler directives (#ifndef etc). My recommendation is the K&R C book:
    http://www.amazon.com/Pro...ernighan/dp/0131103628
     
    or the online C book:
    http://publications.gbdir.../c_book/the_c_book.pdf
     
    #2
    Ian.M
    Super Member
    • Total Posts : 13040
    • Reward points : 0
    • Joined: 2009/07/23 07:02:40
    • Location: UK
    • Status: offline
    Re:Hi-Tech 9.83 Compiling multiple C and header files 2012/12/22 17:35:49 (permalink)
    0
    HiTech C is so close to standard ANSI C89/ISO C90 that you do *NOT* need compiler specific instructions for most things. The manual is NOT a C tutorial, but assumes you are reasonably familiar with standard C.  You have already been directed to K&R and The C Book.   N.B. It is worth avoiding excessively Microsofty books.  Look at the size of the section devoted to Windows specific functions - if more than 10 pages, don't buy!
     
    For a good explanation of what to include where and how to decide whether a particular part of your code should be in a .c or a .h file, read Organizing Code Files in C and C++ (from gamedev.net). Ignore the C++ specific stuff. Googling: multiple C header files would have led you straight to it.  You should also read [this topic]  which has some Microchip specific stuff.
     
    N.B. You can take any technical information or advice from the user mad_c as absolutely authoritative.   He was the Senior Software Engineer at HiTech and and is a senior member of Microchip's HiTech C/XC8 team.
    #3
    Laury
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2012/08/27 20:15:19
    • Location: Nashville, TN
    • Status: offline
    Re:Hi-Tech 9.83 Compiling multiple C and header files 2012/12/22 18:35:04 (permalink)
    0
    Thanks! This is what I've been looking for.
     
    G'day! and Happy Holidays.
     
    RonL
     
    "For a good explanation of what to include where and how to decide whether a particular part of your code should be in a .c or a .h file, read Organizing Code Files in C and C++ (from gamedev.net). Ignore the C++ specific stuff. Googling: multiple C header files would have led you straight to it.  You should also read [this topic]  which has some Microchip specific stuff."
    #4
    Jump to:
    © 2017 APG vNext Commercial Version 4.5