hexagon5un / AVR-Programming

Code examples for the book "Make: AVR Programming"
http://littlehacks.org/AVR-Programming
MIT License
725 stars 340 forks source link

Undefined reference to initUSART #8

Closed djsherrill closed 9 years ago

djsherrill commented 9 years ago

Hi, I'm using AVR studio and when I compile the SerialLoopback code I get an error "undefined reference to 'initUSART. I copied over the USART.h file to my working directory and I'm not receiving any errors for that file. Thanks, Derek

hexagon5un commented 9 years ago

Sorry for the late reply.

Studio does strange things. Are you using the Studio makefile or mine? If Studio's, then it won't know where to find the additional headers and code that lives in AVR-Programming-Library/

As you noticed, the easiest way to fix everything with Studio is just to copy the contents of the AVR-Programming-Library/ folder into each and every project's folder.

There must also be a way to add additional code/library folders to the project, but I haven't used Studio extensively in like 10 years.

Hope you've gotten it working in the meantime. Let me know?

hexagon5un commented 9 years ago

Closing for inactivity.

Hope all worked out. :)

naveengautam002 commented 7 years ago

hi, i am using avr studio 7 to compile the serialloop.c , and got these error and i copied all the USART.h and USART.c file in project folder.

Error undefined reference to initUSART' Error undefined reference toprintString'
Error undefined reference to receiveByte' Error undefined reference totransmitByte'
Error ld returned 1 exit status

Please help me.