• AVR Freaks

Writing libraries for MPLAB X IDE/XC8

Author
Rian
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2018/12/10 09:47:37
  • Location: 0
  • Status: offline
2020/03/24 09:36:57 (permalink)
0

Writing libraries for MPLAB X IDE/XC8

Is it possible to create some kind of a library when you've code thats tested and works like it should that you may want to reuse in other projects? How do you do this? I have different .c/.h files that I use in many projects and now tend to copy/paste them from one project to another and it's hard to keep track of the latest version of this codebase. 
#1

2 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18424
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Writing libraries for MPLAB X IDE/XC8 2020/03/24 09:45:29 (permalink)
    +1 (1)
    Your Files should Have Versions in them..  Then include the
    Maybe as #defines so your code can tell.
    You can make an actual C library.  It is a special type of Project.
    A package of C and H files are also common.
     
    Your Problem is you copy them from on Project to another.
    They Need a Home where the Latest version live.  Not spread out over several projects.
    #2
    TK50
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/01/05 00:32:20
    • Location: 0
    • Status: offline
    Re: Writing libraries for MPLAB X IDE/XC8 2020/03/25 22:55:36 (permalink)
    +2 (2)
    Rian
    Is it possible to create some kind of a library when you've code thats tested and works like it should that you may want to reuse in other projects? How do you do this? I have different .c/.h files that I use in many projects and now tend to copy/paste them from one project to another and it's hard to keep track of the latest version of this codebase. 




    You make one particular folder for your library without any MPLAB Projects contents. (no main.c, no build folder etc.)
    In this folder you have only your library with a lot of .c und .h files.
     
    In your Projects, you add your library in the Project Panel and add you header and source files.

    Attachment(s)

    Attachments are not available: Download requirements not met
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5