Society of Robots - Robot Forum

Software => Software => Topic started by: GWER57 on December 09, 2009, 11:19:43 AM

Title: avrlib error
Post by: GWER57 on December 09, 2009, 11:19:43 AM
Hi, I am working on a project that is based on an ATMega 328p. Every thing has been going well ;D but when I try to use any of the functions from avrlib the compiler says this:

undefined reference to uartSendByte
undefined reference to rprintfInit
undefined reference to uartInit

etc.

If anyone could help me out that would be great :D and the sooner the better because I am going to use this as a Christmas present.

Thanks
Title: Re: avrlib error
Post by: z.s.tar.gz on December 09, 2009, 01:24:43 PM
Could you please post your code?
Title: Re: avrlib error
Post by: GWER57 on December 09, 2009, 05:18:20 PM
Could you please post your code?

Here it is:

#include <avr/io.h>
#include <util/delay.h>
#include "uart.h"
#include "rprintf.h"
#include "global.h"

#define F_CPU 8000000

int main()
{

    uartInit();                 // initialize UART (serial port)
    uartSetBaudRate(9600);      // set UART speed to 9600 baud
    rprintfInit(uartSendByte);  // configure rprintf to use UART for output
}
Title: Re: avrlib error
Post by: Webbot on December 10, 2009, 02:01:37 PM
How are you building the file? In AVRStudio or a makefile?

Not that it will change much but you should specify the CPU speed in the build file rather than the source file but it makes me wonder if your build file is also not specifying the processor type.
Title: Re: avrlib error
Post by: GWER57 on December 13, 2009, 07:01:33 PM
How are you building the file? In AVRStudio or a makefile?


In AVRStudio