سلام
من با winavr موقع استفاده از بعضی از کتابخونه ها ، وقتی از توابع اون کتابخونه استفاده می کنم با خطای undefined reference مواجه میشم !
همه چیز درسته ، ولی به هر تابعی که استفاده بکنم خطا میده !
این سری هم کتابخونه uart
این برنامه من
#include "global.h"
#include <stdlib.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "uart.h"
#include "rprintf.h"
//--------------------------------------------------
void init_HW();
void rx_handler(unsigned char c);
//--------------------------------------------------
void rx_handler(unsigned char c){
// Do simething with recieved character `c'
}
int main( void ){
_delay_ms(100);
init_HW();
// Send to serial port
rprintf("Hello world!\n"
;
while(1);
return 0;
}
void init_HW(void){
uartInit();
uartSetBaudRate(9600);
rprintfInit(uartSendByte);
// uartSetRxHandler(rx_handler);
sei();
}
اینم لیست خطاهایی که میگیره !
Error 1 undefined reference to `uartInit' a-i-o.c 34 1 a-i-o
Error 2 undefined reference to `uartSetBaudRate' a-i-o.c 35 1 a-i-o
Error 3 undefined reference to `uartSendByte' a-i-o.c 36 1 a-i-o
Error 4 undefined reference to `uartSendByte' a-i-o.c 36 1 a-i-o
Error 5 undefined reference to `rprintfInit' a-i-o.c 36 1 a-i-o
Error 6 undefined reference to `rprintf1RamRom' a-i-o.c 26 1 a-i-o
کتابخونه هارو هم ضمیمه کردم
ممنون
من با winavr موقع استفاده از بعضی از کتابخونه ها ، وقتی از توابع اون کتابخونه استفاده می کنم با خطای undefined reference مواجه میشم !
همه چیز درسته ، ولی به هر تابعی که استفاده بکنم خطا میده !
این سری هم کتابخونه uart
این برنامه من
#include "global.h"
#include <stdlib.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "uart.h"
#include "rprintf.h"
//--------------------------------------------------
void init_HW();
void rx_handler(unsigned char c);
//--------------------------------------------------
void rx_handler(unsigned char c){
// Do simething with recieved character `c'
}
int main( void ){
_delay_ms(100);
init_HW();
// Send to serial port
rprintf("Hello world!\n"

while(1);
return 0;
}
void init_HW(void){
uartInit();
uartSetBaudRate(9600);
rprintfInit(uartSendByte);
// uartSetRxHandler(rx_handler);
sei();
}
اینم لیست خطاهایی که میگیره !
Error 1 undefined reference to `uartInit' a-i-o.c 34 1 a-i-o
Error 2 undefined reference to `uartSetBaudRate' a-i-o.c 35 1 a-i-o
Error 3 undefined reference to `uartSendByte' a-i-o.c 36 1 a-i-o
Error 4 undefined reference to `uartSendByte' a-i-o.c 36 1 a-i-o
Error 5 undefined reference to `rprintfInit' a-i-o.c 36 1 a-i-o
Error 6 undefined reference to `rprintf1RamRom' a-i-o.c 26 1 a-i-o
کتابخونه هارو هم ضمیمه کردم
ممنون
دیدگاه