Created By: Hussein Nosair
Symptoms:
The MPLAB IDE shows the following error message when trying to compile a project:
“ Error – could not find file ‘c018i.o’. “
Solutions:
1. Sol.: 1
Sometimes the workspace file gets corrupted. To solve this problem:
1. Close your project if necessary
2. Go to the project directory.
3. Delete the workspace file that ends with mcw :: YourProject.mcw
4. Open your project again. MPLAB IDE will take care of rebuilding and creating a new workspace file for your project.
6. Try to compile your project.
2. Sol.:2
Sometimes a one forget to include the appropriate/required linker file of used Microchip Microcontroller (uC) in the Project. To solve this problem:
1. Open your project in the MPLAB if necessary.
2. Determine the uC is being used for the project in hand. Click on Configure > Select Device…
![]()
Select Device Window will open, showing the chosen Device (uC) for the project.
4. In the Project Window on the left:
Right Mouse Click on Linker Script > Add Files…
And Browse to the MPASM folder to locate the chosen uC linker file
4. Try to compile the project again.
3. Sol.:3 (Preferred Method)
I use the solution 3 for all of my projects. Before we begin, I should state that the following example is based on the use of MPLAB C18 compiler. However, the example can be transferable to other mplab configurations. To solve this problem:
1. Open your project in the MPLAB if it is not already open.
2. Click on Project > Build Options… > Project
3. Click on Directories tab > From the Show directories for: Drop list select “output Director”
4. Click the “New” Button
5. Type in: Output – Hex Files, and then Hit ENTER
6. From the Show Directories for Drop list select “Intermediary Directory”
7. Click the “New” Button
8. Type in: Object – Linking Files
9. From the Show Directories for Drop list select “Include Search Path”
10. Click the “New” Button
11. We are going to include the compiler’s header files folder (*.h) which you use to compile and build your project. In my case I am using MPLAB C18 compiler for my current projects. The header files are located in “h” folder at “C:\MCC18\h”. Either you type in the location of the compiler’s herder files or you click on the “ … “ Button to locate the header files folder.
12. Click the “New” Button
13. We are going to include the current opened project folder, incase of the project folder houses a custom built header files. Refer to the picture above.
14. Click the “New” Button
15. Type in: .
NOTE: The order of items in the list. The compiler will first look for files in the project folder if it cannot find the required files then the compiler will move on to the next item in the list which would be in this case “C:\MCC18\h”. Refer to the above picture for reference.
16. From the Show Directories for Drop list select “Library Search Path”
17. Click the “New” Button
18. We are going to include the compiler’s library files, by clicking on the “ … “ Button. Refer to the picture above.
19. From the Show Directories for Drop list select “Linker-Script Search Path”
20. Click the “New” Button
21. We are going to include the Microcontroller’s Linker files, by clicking on the “ … “ Button. Refer to the picture above.
NOTE: I prefer to use the linker-script files that came in with the compiler. However, if your compiler does not come with a Linker-Script files then you need to browse to the following folder location:
Vista 64-bit users: C:\Program Files (x86)\Microchip\MPASM Suite\LKR
Windows XP and Vista 32-bit users: C:\Program Files\Microchip\MPASM Suite\LKR
DONE.
EEWeb Electronics Forum












