Circuit Negma

C++, C, VB.NET, PCB, Electronics, Circuit Design

Microchip MPLAB :: Error – could not find file ‘c018i.o’.

Posted by Circuit Negma on April 26, 2010


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.

10 Responses to “Microchip MPLAB :: Error – could not find file ‘c018i.o’.”

  1. Bor said

    Hello Mr. Hussein,

    it’s nice that you present all of these solutions, however I’m still in trouble.
    Sol 1 and 2 are not solving the missing c018i.o file (not really missing) and solution 3 generates this error:

    Error – section ‘_entry_scn’ type is non-overlay and absolute but occurs in more than one input file.

    The IDE is calling linker using this command:

    Executing: “C:\MCC18\bin\mplink.exe” /p18F452 /l”C:\MCC18\lib” “main.o” “C:\MCC18\lib\c018i.o” /u_CRUNTIME /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /m”test_3.map” /w /o”test_3.cof”

    and the path to c018i.o is set properly in the call, but still the “missing file” error remains😦

    Any more hints on how to pass that?

  2. Bor said

    Solution found.

    I edited linker script file from:

    #IFDEF _CRUNTIME
    FILES c018i.o
    FILES clib.lib
    FILES p18f452.lib
    #FI

    to

    #IFDEF _CRUNTIME
    FILES C:\MCC18\lib\c018i.o
    FILES C:\MCC18\lib\clib.lib
    FILES C:\MCC18\lib\p18f452.lib
    #FI

    as in my case all the required files are in C:\MCC18\lib\.

    It is surly possible to fight the problem other way but I just have no idea what Error – section ‘_entry_scn’ type is non-overlay and absolute but occurs in more than one input file mean and how to solve that.

    Cheers.

    • Hi Bor,

      I just want to thank you for sharing your solution.

      My c018i.o problem never persisted with me. However, I will try to find an alternative solution to this problem without touching/editing script file.

      Thank you.

    • ** I searched the internet for the error code 1 :: “Error – section ‘_entry_scn’ type is non-overlay and absolute but occurs in more than one input file.” The error code says that you have included ‘entry section’ multiple times, that is at least twice in your project and I found a lot of people having the same problem due to the fact that they:
      1. included c018i.o, c018i.c in their project and/or project folder, hence creating mutlitple entry points/startup points for linker.
      2. included c (source code) files rather than h (header files) files. The correct way of including definitions is #include “xxxxx.h”
      3. included #include file in their main source code and under project build options, hence creating multiple points for the linker.
      4. using old MPlinker with a newer version of MPLAB C compiler
      and so on

      ** I have done the following trials to duplicate “Error – section ‘_entry_scn’ type is non-overlay and absolute but occurs in more than one input file.”
      1. I added c018i.o file to my project under Object files folder :: and I got the following errors:
      MPLINK 4.34, Linker
      Copyright (c) 2009 Microchip Technology Inc.
      Error – section ‘_entry_scn’ type is non-overlay and absolute but occurs in more than one input file.
      Errors : 1

      2. I added c018i.c to my project under Source files folder :: and I got the following errors:
      MPLINK 4.34, Linker
      Copyright (c) 2009 Microchip Technology Inc.
      Error – section ‘_entry_scn’ type is non-overlay and absolute but occurs in more than one input file.
      Errors : 1

      3. Someone missed up the MPLINK LINKER command line under project build options, which in this case you just need to click on restore defaults button to fix this problem

      In conclusion c018i.o and c018i.c should not be included in the project as long as the lnk file of the processor in use is define in the project tree list or project build options. the lnk file will point the linker to the entry point/startup point defined in c018i

      Hopefully this will clear few things regarding this error

    • Peter said

      In order to resolve this problem without editing the linker script do the following :

      Project -> Build Options -> Project -> Click on the arrow to show directories for “Librarie Search Path” -> new -> browse to “C:\MCC18\lib” -> OK -> Apply

      Now compile the project again. This helped for me. Good luck!

  3. vs said

    I tried the start over method and it worked just fine for me.

    Before that though, I set the paths about 10 times, and nothing worked, even tried doing the recoding of the linker file to the direct file location but it told me “illegal code” or something of that sort.

    • Sorry for not replying back as soon as possible. December is the crazy month of the year, lots of work no rest.

      I am glad that it is working for you now.

      I think this error for some reason looks too general. For the last week and so I have been fighting a new error with the linker. I will be posting the linker error soon.

      Thanks for sharing with us your story

  4. Jestin P.J said

    thanks

  5. ensol said

    hi
    Error – mixing extended and non-extended mode modules not allowed

    i wrote a code for usb in mplab for pic18f4550 and finally i got this message please tell me how i solve this error..

    • Sorry for the late reply.

      I am not sure how to help you on this one. I never had this error before.

      My advice is that you contact microchip tech. support. they are pretty good in responding back.

      You could also search google for that error
      ex: search: mplab Error – mixing extended and non-extended mode modules not allowed.

      I also found the following solution in the microchip knowledge base:
      Solution
      When building your project for extended mode, you must also use the “_e” linker script for your device.

      e.g. 18f6490_e.lkr

      The linker script files are located in the lkr subdirectory of the C18 install.
      (usually “c:\mcc18\lkr”)

      good luck

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: