• AVR Freaks

Hot!Adding files to a project

Author
Niuzu
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2019/01/09 11:18:49
  • Location: 0
  • Status: offline
2020/10/26 07:18:49 (permalink)
4 (1)

Adding files to a project

Hey,
I have a kind of buggy behaviour of something i used in the past, that doesn't work anymore.
 
Usally when I tried to implement new files to my project, I dropped the folder with all source and header files into the projects 'Files' tab. Then I included them to my project by right clicking the 'Header Files' in the 'Projects' tab, 'Add Existing Files From Folder..', 'Add Folder'. Than I 'Select' my new folder with files of type Header. Now i can see the whole files structure of my new folder with all header files. I do the same with the source files. 
 
This procedure has worked for the past 2 years but if I try to do this with a new project and a simple folder structure this doesn't work and the compiler raises a missing symbole error.
 
Has anyone an idea how to fix this?
 
Markus
#1

9 Replies Related Threads

    Niuzu
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/01/09 11:18:49
    • Location: 0
    • Status: offline
    Re: Adding files to a project 2020/10/28 11:29:46 (permalink)
    0
    Hey, 
    I tested some more ways of including files like discribed here:
    https://microchipdeveloper.com/mplabx:add-file-to-project
    https://microchipdeveloper.com/mplabx:add-folder-to-project
     
    The method of adding a file to my project works. It compiles and everything is fine. The method if adding a whole folder still doesn't work.
     
    I even tried to add my files via the Compiler by going to 'Properties' > 'XC8 Compiler' > 'Include directories' I added my folder but the project still can't compile because there are files missing.
     
    :0:: error: (499) undefined symbol:
    _led_on(dist/default/production\PIC18dem.X.production.o)
     
    Has anyone an idea what the problem is?
    #2
    Niuzu
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/01/09 11:18:49
    • Location: 0
    • Status: offline
    Re: Adding files to a project 2020/10/28 14:18:33 (permalink)
    0
    I'm to be on something.
     
    I tested the same process I explained with some colleges. They have the same issue interestingly. We could work around this 'bug' by just going into the 'Project Properties' -> 'Conf: [default] and just hit 'Apply'. We have no clue why, but now the current build compiles with the new folders included.
     
    Unfortunatly if i add another folder, the error is raised again! Thus I have to hit apply again to fix it.
     
    Do i have to config something in my project that this process is automated? What exactly raises this problem? Is it possible that the makefile is not updated properly? Why do we have this behaviour? We reinstalled MPLAB and the Compiler. I have no clue where this problem comes from.
     
    #3
    Mysil
    Super Member
    • Total Posts : 3946
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: online
    Re: Adding files to a project 2020/10/28 14:47:30 (permalink)
    +2 (2)
    Hi,
     
    'Properties' > 'XC8 Compiler' > 'Include directories'  that you have tried in message #2 have nothing to do with Project structure in MPLAB X. 'Include directories'  is the search list of directory paths, that is passed to the C compiler, and is used by the compiler when opening #include files.
    The Compiler know nothing about MPLAB project structure. It know only the location of the current .c source file, and the search list of 'include directories'. (And the compiler installation directories for 'system' header files.)
     
        Mysil
    #4
    Niuzu
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/01/09 11:18:49
    • Location: 0
    • Status: offline
    Re: Adding files to a project 2020/10/28 15:11:26 (permalink)
    0
    @Mysil Okay, I see. Thanks for that explanation.
     
    But do you have any clue about my problem that still exists and i explained further more in my latest post?
     
    #5
    Mysil
    Super Member
    • Total Posts : 3946
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: online
    Re: Adding files to a project 2020/10/28 15:45:58 (permalink)
    +1 (1)
    Hi,
    I usually never use the 'Files' tab in MPLAB X,
    I use ordinary operating system file browser to copy or move files around.
    Then use single file 'Add Existing Item...'    selection box.  It works well to select multiple files to insert in the same project folder.
     
        Mysil
    #6
    Niuzu
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/01/09 11:18:49
    • Location: 0
    • Status: offline
    Re: Adding files to a project 2020/10/29 11:33:25 (permalink)
    +1 (1)
    Just to sum it up.
     
    If i have a complexe project i want to import into a new project, I have to pick every single .c and .h file in this whole folder structure and add it myself?
    #7
    Neiwiertz
    Super Member
    • Total Posts : 2131
    • Reward points : 0
    • Joined: 2004/09/01 02:58:52
    • Status: offline
    Re: Adding files to a project 2020/11/02 06:09:37 (permalink)
    -1 (1)
    create empty project save it, next add one file save it, and compare both, notice how the project xml files are changed, then use editor like vscode to add more files

    Flying With --|Explorer 16|HardWare|SoftWare|-- Fav(s) Gallery Lists
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5