0
\$\begingroup\$

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.

\$\endgroup\$
6
  • \$\begingroup\$ 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. \$\endgroup\$
    – Lundin
    Jul 6 '20 at 12:55
  • \$\begingroup\$ What happens if you empty MPLABx cache and build ones more? \$\endgroup\$
    – Mike
    Jul 6 '20 at 13:02
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Swedgin
    Jul 6 '20 at 13:15
  • \$\begingroup\$ Did you copy another project to create this project? \$\endgroup\$
    – HandyHowie
    Jul 6 '20 at 17:34
  • \$\begingroup\$ @Mike Same. The problem doesn't go away. \$\endgroup\$
    – Ahmed
    Jul 7 '20 at 5:35
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.