Hot!I can not indicate an external header file

Author
Neraildes
Starting Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2017/10/11 07:13:25
  • Location: 0
  • Status: offline
2017/10/12 04:45:19 (permalink)
0

I can not indicate an external header file

Hi,
I can not indicate an external header file.
The following error occurs:
 
cdc1000.c:22: error: (141) can't open include file "eeprom.h": No such file or directory
 
I use the "MPLAB IDE" and the compiler "XC 8"
I have tried to use a folder "C: \ XC8" but still the error continues.
#1

18 Replies Related Threads

    JorgeF
    Super Member
    • Total Posts : 2777
    • Reward points : 0
    • Joined: 2011/07/09 11:56:58
    • Location: Barcelona/Spain/Europe/Third rock from the Sun
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 07:15:43 (permalink)
    +1 (1)
    Hi
     
    What is the actual path for that include file?
    I supose you made sure it exists.
     
     
    Best regards
    Jorge
     
    #2
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 08:31:48 (permalink)
    0
    Hi,
    Yes, the folder path exists and is valid.
    I was using folder names started with numbers,
    so I removed all the numbers and blanks from the path, and it looked like this:
     
    C:\Dropbox\nesix\Projetos\nesix\Bibliotecas\XC8
     
    But it still does not work, but the compiler has changed the error message.
     
    cdc1000.c: 22: error: (141) can not open include file "eeprom.h": No such file or directory
     
    I suppose I should open a new project so that the path and name changes take effect.
     
    Best regards
    Neraildes
    #3
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 08:31:59 (permalink)
    0
    Hi,
    Yes, the folder path exists and is valid.
    I was using folder names started with numbers,
    so I removed all the numbers and blanks from the path, and it looked like this:
     
    C:\Dropbox\nesix\Projetos\nesix\Bibliotecas\XC8
     
    But it still does not work, but the compiler has changed the error message.
     
    cdc1000.c: 22: error: (141) can not open include file "eeprom.h": No such file or directory
     
    I suppose I should open a new project so that the path and name changes take effect.
     
    Best regards
    Neraildes
    #4
    Jim Nickerson
    User 452 _
    • Total Posts : 4240
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 09:23:27 (permalink)
    0
    Is "C:\Dropbox" a local folder on the PC local drive ?
     
    #5
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 10:08:18 (permalink)
    +1 (1)
    Yes, "C:\Dropbox" a local folder on the PC local drive!
    #6
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 10:09:40 (permalink)
    0
    I tried to use it this way and it worked.
     
    #include "../../../../../nesix/Bibliotecas/XC8/eeprom.h"
     
    I believe the reason for the problem is that I did not indicate in which folder the external files are.
    #7
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 10:22:02 (permalink)
    0
    My project folder is:
    C:\Dropbox\nesix\Projetos\CCB_Equipamentos\Dip_Coating\CDC1000\Firmware
     
    The folder of my external files is:
    C:\Dropbox\nesix\Projetos\nesix\Bibliotecas\XC8
    #8
    JorgeF
    Super Member
    • Total Posts : 2777
    • Reward points : 0
    • Joined: 2011/07/09 11:56:58
    • Location: Barcelona/Spain/Europe/Third rock from the Sun
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 11:25:58 (permalink)
    +1 (1)
    Hi
     
    The pathname was your problem.
    The "#include" directive only searches the local project folder (#include "....") or the toolchain (XC8) paths ("#include <....>").
    If you want it to search for your personal libs "....\Bibliotecas\..." you have to add this path in the project properties.
     
     
    HIH
     
    Best regards
    Jorge
     
    #9
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 11:28:44 (permalink)
    0
    How can I indicate the external files folder so the include does not stay so long. The correct thing would be to have only the header file name.
     
    #include "../../../../../nesix/Bibliotecas/XC8/eeprom.h"
    #10
    NKurzman
    A Guy on the Net
    • Total Posts : 14954
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: I can not indicate an external header file 2017/10/12 11:35:57 (permalink)
    0
    You would need to include that folder in the Project include Path.
    #11
    qhb
    Superb Member
    • Total Posts : 6253
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: I can not indicate an external header file 2017/10/12 12:12:55 (permalink)
    +1 (1)
    Be aware that "eeprom.h" is part if the old Peripheral Libraries (PLIB) that no longer come with XC8.
    Just including an eeprom.h file you found somewhere will  NOT give you access to the PLIB functions.
     
    #12
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 13:29:20 (permalink)
    0
    I found the native call to EEPROM, but I need to include my own EEPROM routine because it has some special calls.
    Can you explain to me where I make this folder inclusion, I already tried to find but did not find.
    #13
    mad_c
    Super Member
    • Total Posts : 1044
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 13:37:49 (permalink)
    +2 (2)
    Hi,
     
    I think the section of the User's Guide (rev H) you will find handy is Section 4.8.4 -I: Include Search Path. That has a description of the command-line argument, and then a link to what you do in the IDE if you are using that to build.
     
    Jeff.
     
    #14
    qhb
    Superb Member
    • Total Posts : 6253
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: I can not indicate an external header file 2017/10/12 13:49:57 (permalink)
    0
    Neraildes
    I found the native call to EEPROM, but I need to include my own EEPROM routine because it has some special calls.
    Can you explain to me where I make this folder inclusion, I already tried to find but did not find.

    If you want to add some custom eeprom access code, why not put all the necessary files into the same folder as your project?
     
    #15
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 14:27:44 (permalink)
    0
    I leave out the project folder so when I make updates in the code change also all other projects. I want to have only one EEPROM access file.
    #16
    Aussie Susan
    Super Member
    • Total Posts : 2902
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: I can not indicate an external header file 2017/10/12 20:56:19 (permalink)
    +2 (2)
    If you are trying to write code that is used across multiple projects then look to making it a library.
    Also remember that you will have to know which are the projects that use that bit of common code and (at least) relink them all.
    I suspect that you may be actually making things harder for yourself by taking this approach.
    Susan
    #17
    Neraildes
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2017/10/11 07:13:25
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/13 02:32:52 (permalink)
    +1 (1)
    I decided to put the header and C files inside the project folder, so if I need to, I'll have all the files in one place. I've put update information on them so I'll know which is the most current.
     
    Thank you all for your help .
    #18
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 1473
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: I can not indicate an external header file 2017/10/14 15:11:04 (permalink)
    -1 (1)
    If you have all your projects/libraries in the same folder then you only need to step back one folder.
     
    #include "../I2CLib.X/I2CLib.h"

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #19
    Jump to:
    © 2017 APG vNext Commercial Version 4.5