0

I am trying to build a simple project for PIC32MX270F256. The code is just this:

#include <xc.h>
#include "PIC32MX270_STD.h"
#include "Delay.h"

#define LED LATBbits.LATB14

/*******************************************************************************
* Function Name: void initMain (void)
*
* Specification: initializes main
*
*******************************************************************************/
void initMain(void)
{  
    uc_init();              // initialize microcontroller
    TRISBbits.TRISB14 = 0;  // set PINB1 as output
}


/*******************************************************************************
* Function Name: void main (void)
*
* Specification: main function
*
*******************************************************************************/
void main(void) {
    
    initMain();         // initializes main function
    
    while(1)
    {
     LED = !LED;       // toggle LED
     delay_ms(1000);   // delay 1 second
    }
}

I am using MPLABX v5.30 and XC32 v2.41.

But I am unable to build the project. I get the following errors:

pic32m-gcc.exe: error: build/default/production/PIC32MX270_STD.o: No such file or directory
pic32m-gcc.exe: error: build/default/production/main.o: No such file or directory
pic32m-gcc.exe: error: build/default/production/Delay.o: No such file or directory
make[2]: *** [dist/default/production/01_Blink.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

Please see the following screenshot for further clarification: enter image description here

Your help is much appreciated.

Ahmed
  • 171
  • 1
  • 6
  • 2
    Seems that the compiler didn't create an output files in a directory where the linker can find them. Either because of compiler errors or because you have some compiler/linker path hiccup, where the compiler places the files in one directory and the linker looks in a different one for them. – Lundin Jul 06 '20 at 12:55
  • What happens if you empty MPLABx cache and build ones more? – Mike Jul 06 '20 at 13:02
  • 3
    Check your project settings. Update to v5.40. That's MPLAB X IDE for you, be ready for lots more wierd bugs and errors, where you sometimes have to restart your pc. – Swedgin Jul 06 '20 at 13:15
  • 1
    Did you copy another project to create this project? – HandyHowie Jul 06 '20 at 17:34
  • @Mike Same. The problem doesn't go away. – Ahmed Jul 07 '20 at 05:35
  • @HandyHowie by this point, I have created dozens of new project and also tried to build old ones. – Ahmed Jul 07 '20 at 05:36

1 Answers1

1

Problem resolved. Tried @Swedgin's approach: Wiped my PC clean of every software from Microchip, Installed latest versions of only required Softwares and plugins, then built a couple of new projects and all is well so far. Hope it remains like this.

Ahmed
  • 171
  • 1
  • 6