Author Topic: avrlib error  (Read 1661 times)

0 Members and 1 Guest are viewing this topic.

Offline GWER57Topic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 2
avrlib error
« 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
GTW

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: avrlib error
« Reply #1 on: December 09, 2009, 01:24:43 PM »
Could you please post your code?
Save yourself the typing. Just call me Zach.

Offline GWER57Topic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 2
Re: avrlib error
« Reply #2 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
}
GTW

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: avrlib error
« Reply #3 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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline GWER57Topic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 2
Re: avrlib error
« Reply #4 on: December 13, 2009, 07:01:33 PM »
How are you building the file? In AVRStudio or a makefile?


In AVRStudio
GTW

 


data_list