MPLABX compile and build error.

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Thank you for viewing my post.

I have downloaded the MDD library to use with sending data from a PIC18F26K22 to a SD card. I am using the XC8 compiler. When I load the demo program from the library into MPLABX V 3.45 I get the following error:

Error (141) can't open include file "FSIO.H" no such file or directory.

I have loaded the FSIO.H file into my project into the Header file and when I click on it, it will load the file so I know the file is there. The only include file listed in the program is: Include "FSIO.H". I compile and build the program, and I still get the same error. I have changed the microcontroller in the program to reflect the PIC18F26K22.

I am not sure why this will not compile and build and am looking for guidance to solve this issue.

Thank you,

Peaches41
 

AlbertHall

Joined Jun 4, 2014
8,313
I don't know whether this is the problem but try using a lower case 'h' as the extension for both the file and the include line. I know that XC8 tends to not like '.C' extensions.
 

JohnInTX

Joined Jun 26, 2012
3,798
As @AlbertHall says, MPLAB/Windows can be fussy about filename case.

How did you specify FSIO.h in the source and where is it? If it is in quotes #include "FISO.h", the compiler expects the file in the current source directory. If it is in brackets #include <FISO.h>, the compiler will search for the header file in the default directory (where xc.h is) plus the locations specified in the project:
Project Properties->XC8 global options->XC8 compiler->Preprocessing and messages->Include directories. Browse to the directory that contains the file and add it to the list.

Note that the Project Window that you click on to open files to edit/view is not the same as what the compiler uses to find files so MPLABX may be able to find the file but the compiler can't if it is in a nonstandard place or if you have not specified the path with "", <> or absolute path (not recommended).

Good luck!
 

Thread Starter

Peaches41

Joined Dec 15, 2016
70
I have tried both brackets and quotes and both give me the same error message. I then used project properties link as you suggested and traced the file: Microchip solutions-> microchip-> include-> mdd file system and there is nothing there and it lists that it is showing all files at the bottom of the open box. I can go into OS-> and then: Microchip solutions-> microchip-> include-> mdd file system and I see that the files are there, but I just do not know why they do not show up when I use the path using the project properties.

This could be why I am getting the error but I do not know why they show up one way but not the other.


Thank you,
Peaches
 

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Also noticed in selecting item in hte lower right corner it lets you choose a "store path as" either auto, relative, or absolute. Will this affect the path?

Peaches
 

JohnInTX

Joined Jun 26, 2012
3,798
Hmm.. to be clear, here is a screenshot of where you should be adding the paths for the compiler. I am assuming MPLABX, the process is similar in MPLAB 8.x. Is that what you are doing? Relative/absolute refers to how MPLAB builds the path. As long as you don't move anything after locating the files, you are OK with either. Once a path is added, you specify the file with <file.h>, not quotes.

An absolute path is used for libraries etc. that don't change locations from project to project or if the project itself is moved. A compiler's peripheral library is an example.

Relative paths are relative to the project so if you add one then move the project they are still in place with respect to the project directory. Project-specific libraries that have to be kept with the project are usually specified as relative.
 

Attachments

Last edited:

spinnaker

Joined Oct 29, 2009
7,815
See if you can open the file with the editior and make sure it is a valid file.

You don't need to set the directory in properties if the file is in your project directory.

Surround the file name with quotes. #include "FIOS.H"

Make sure the #includes are at the top of your file.. But after your configuration switches if using MPLABX).
 

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Thank you for your insights into fixing my issue. I will look into this more. I was also wondering if I needed to use the C18 compiler instead of the XC8 compiler for this library as the version 1.4.4 was released in 2013? Or, am I ok w/ XC8 for this....just wondering.


Thank you all for your help.

Peaches
 

spinnaker

Joined Oct 29, 2009
7,815
C18 has not been supported for years. If you are working with the 8 bit family of chips you want to use XC8.
 

GopherT

Joined Nov 23, 2012
7,983
Thank you for your insights into fixing my issue. I will look into this more. I was also wondering if I needed to use the C18 compiler instead of the XC8 compiler for this library as the version 1.4.4 was released in 2013? Or, am I ok w/ XC8 for this....just wondering.


Thank you all for your help.

Peaches
You should find a modern library to make sure everything is compatible. I'm not sure all C18 libraries work in XC8. This is for writing to SD cards?
 
Top