Undefined reference to

Undefined reference to

Postby vra » Sat Sep 07, 2019 12:04 am

Hi all, how are you?.

Since yesterday I have a problem, my code was working well and suddenly after doing some commits and merge's then when I try to compile the project to run the code it says this:
 
Code: Select all
nbproject/Makefile-default.mk:163: recipe for target 'dist/default/production/Control_LCD.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/valery/MPLABXProjects/Control_LCD.X'
nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/valery/MPLABXProjects/Control_LCD.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
build/default/production/main.o(.text+0x8): In function `_main':
: undefined reference to `_Confi_PuertoD'
make[2]: *** [dist/default/production/Control_LCD.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

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

 
the problem is that I'm looking the master branch and all the files involved in it, I've merged all in the master branch and I can look all the files in the project tree (actual branch), even the library that calls the function that is giving me the error is included in main.
 
My main code is this:
 
Code: Select all
#include <xc.h>
#include "sistema.h"
#include "E_S.h"

int main(void) {
Tipo_Osc(PROSC);
Confi_PuertoD(0b1111000000000000);
LATD = 0b1010101010101010;
while (1);
return 0;
}

 
and Confi_PuertoD is defined in E_S.h, of course the prtotype and the functions are well written and they doesn't have errors right now.
 
E_S.h is this:
 
Code: Select all
#ifndef E_S_H
#define E_S_H

#include <xc.h> // include processor files - each processor file is guarded.

void Confi_PuertoD(unsigned int pinesD); /* Prototipo de función para
* configurar el funcionamiento
* del puerto D. */

#endif /* E_S_H */

 
and E_S.c is this:
 
Code: Select all
#include "E_S.h"

void Confi_PuertoD(unsigned int pinesD) /* Función para configurar el
* funcionamiento del puerto D. */
{
TRISD = pinesD;
ODCD = 0;
}

 
I've followed the steps described in the following thread
 
https://www.microchip.com/forums/m938906.aspx
 
and I still have the same problem.
 
How can I solve this?
vra
 
Posts: 2
Joined: Mon Jul 15, 2019 1:54 pm
PIC experience: Professional 1+ years with MCHP products

Re: Undefined reference to

Postby vra » Sat Sep 07, 2019 12:19 am

I've tried to post in microchip forum too but is giving me a firewall error with the exact same text posted up here.
vra
 
Posts: 2
Joined: Mon Jul 15, 2019 1:54 pm
PIC experience: Professional 1+ years with MCHP products


Return to PIC24

Who is online

Users browsing this forum: No registered users and 4 guests

cron