Autor Tema: Alguien puede decirme que error estoy cometiendo?  (Leído 2613 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado cabrito

  • PIC10
  • *
  • Mensajes: 2
Alguien puede decirme que error estoy cometiendo?
« en: 12 de Noviembre de 2008, 10:53:53 »
Programe esto en la casa de un amigo, lo compile y simule y funcionó pero cuando lo pruebo en mi pc me larga un error.


Les dejo el código:

#include <p18f1330.h>
#include <pwm.h>
#include <usart.h>

const unsigned char buff4[]={"RS232 38400bp8n1"};


void main (void) {
   
   OpenUSART( USART_TX_INT_OFF & USART_RX_INT_OFF &
   USART_ASYNCH_MODE & USART_EIGHT_BIT &
   USART_CONT_RX & USART_BRGH_HIGH,12);      // 19200 bps a 4 MHz

   putrsUSART("Testing Rs232 pic18f1330 \n");


   TRISB = 0X00;

   PTCON0=0b11111100;
   PTCON1=0b10000000;

   PWMCON0=0b01100111;
   PTPERH=0;
   PTPERL=0xff;

   PDC0H=0;
   PDC0L=206;

   PDC1H=0x02;
   PDC1L=0x27;
   

   
   while (1)
   {
      
      Nop();
      Nop();
      Nop();
   }   
}

El error q me larga es el siguiente:


----------------------------------------------------------------------
Debug build of project `C:\pwm1\pwm.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Nov 12 10:51:13 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\pwm1\pwm.o".
Clean: Deleted file "C:\pwm1\pwm.mcs".
Clean: Done.
Executing: "C:\MCC18\bin\mcc18.exe" -p=18F1330 /i"C:\MCC18\h" "pwm.c" -fo="pwm.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\pwm1\pwm.c:15:Warning [2066] type qualifier mismatch in assignment
Executing: "C:\MCC18\bin\mplink.exe" /l"C:\MCC18\lib" "18f1330.lkr" "pwm.o" /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"pwm.cof" /M"pwm.map" /W
MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'putrsUSART' in file './pwm.o'.
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\pwm1\pwm.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Wed Nov 12 10:51:13 2008
----------------------------------------------------------------------
BUILD FAILED

Creo que es un error de librerias, si alguien puede darme una mano por favor, le agradezco de antemano


Les adjunto la carpeta del proyecto

Desconectado micro_cadaver

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 2102
    • blog microembebidos
Re: Alguien puede decirme que error estoy cometiendo?
« Respuesta #1 en: 12 de Noviembre de 2008, 15:22:39 »
cuando compilas un programa en c18 en una pc específica, este genera un archivo con el cual relaciona la ubicacion de los linker library y demas archivos (incluso la ubicación de este *.c) , entonces cuando llevas todo el proyecto o el workspace a otra pc te arrojan esos resultados de error de ubicacion, fijate en eso.

intenta creando denuevo el proyecto con el wizard y jala el archivo *.c (el main).

a menos que tu c18 este mal configurado.

saludos.
a cosechar!!!... :P
pic32... ahi voy....
aguante el micro 16f84  !!!!

visita mi pagina: http://www.microembebidos.wordpress.com

Desconectado cabrito

  • PIC10
  • *
  • Mensajes: 2
Re: Alguien puede decirme que error estoy cometiendo?
« Respuesta #2 en: 12 de Noviembre de 2008, 15:37:20 »
cuando compilas un programa en c18 en una pc específica, este genera un archivo con el cual relaciona la ubicacion de los linker library y demas archivos (incluso la ubicación de este *.c) , entonces cuando llevas todo el proyecto o el workspace a otra pc te arrojan esos resultados de error de ubicacion, fijate en eso.

intenta creando denuevo el proyecto con el wizard y jala el archivo *.c (el main).

a menos que tu c18 este mal configurado.

saludos.

Ya había probando crear todo de nuevo... creo que el problema es con la usart.h
Borre esa parte del puerto serie y me compila, programe el pic y el pwm funciona bien.
El c18 esta bien configurado... configure el MPASMWIN.exe, mplink.exe, mcc18.exe y el mplib.exe todo desde C:\MCC18

Se te ocurre que otra cosa puede estar pasando?


Acá pongo algo que encontré pero no entiendo bien lo que dice:

An error that “c018i.o is not found” could mean that the library path is not set
up correctly. Refer to Section 3.7 “Verify Installation and Build Options” for
information on setting up the library path
If a message says it can not find a definition of “main” in c018i.o, make sure “main”
is spelled all lower case since C is case-sensitive.
An error that reads “could not find definition of symbol...” is usually
caused by using the wrong linker script:
Make sure that the 18F452.lkr file in the mcc18\lkr directory is used. MPLAB IDE
also has a linker script for assembler-only projects in one of its subdirectories. Always
use the mcc18\lkr linker scripts for all projects using the MPLAB C18 compiler.
If “Hello, world!” does not appear in the Output window, try these steps:
1. Make sure that the simulator is selected (Debugger>Select Tool>MPLAB SIM).
2. Make sure the Uart1 is enabled to send printf() text to the MPLAB IDE
Output window as shown in Figure 3-15.
3. Select the Halt icon (Figure 3-16).
4. Build All again. There should be no errors in the Output window, and the
message “Build Succeeded” should appear as the last line (Figure 3-13).
5. Select the Reset icon on the Debug Toolbar (Figure 3-16).
6. Select the Run icon on the Debug Toolbar (Figure 3-16).
Note: To clear the Output window, right click the mouse button and select the
Clear Page option.

Y acá otra más:

EM-7 Linker error: “Could not find definition of symbol...”
This can be caused by using the wrong linker script. Linker scripts for MPLAB C18
include other library files. Make sure to use the linker scripts in the lkr subdirectory of
the MPLAB C18 install.
The project builds OK but when the linker tries to link, the following error is displayed:
Error - could not find definition of symbol 'putsMYFILE' in file
'C:\My Projects\myfile.o'.
Errors : 1
It may be that a C file has the same name as an assembly file, even though they have
different extensions. Look carefully at the Output window to see if it’s trying to generate
two “.o” files with the same name. This is effectively like omitting the first file from the
project. Rename files so that they don’t share the same name.

Agradezco tu ayuda!





« Última modificación: 12 de Noviembre de 2008, 15:43:13 por cabrito »

Desconectado RICHI777

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 1498
Re: Alguien puede decirme que error estoy cometiendo?
« Respuesta #3 en: 12 de Noviembre de 2008, 22:24:37 »
Hola, el problema no es archivo header usart.h porque sino hubiese fallado la compilación, el problema que tenes esta en el linker ya que que no puede enlazar el archivo de libreria que tiene la implementación de la función putrsUSART, fijate si existe en la parte de configuración la manera de definir los paths de las librerias o si existe la manera de decirle al linker que incluya la implementación de la misma.

Saludos !