Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Compiling problems


#1

I am having problems with compiling code. I was able to compile the blinkled program that was in the users guide with no problem, however whenever I attempt to compile my own code or code that I have copy/pasted from the users guide I get a long string of error messages. It says that there is an “undefined reference” to every command on every line of these programs. I am lost, and even google has not provided an answer which is why I am coming here.

This is the output for the code here: https://www.pololu.com/docs/0J21/7.b\

avr-gcc -g -Os -Wall -mcall-prologues -mmcu=atmega328p -c -o linefollow.o linefollow.c
runs without error
avr-gcc -g -Os -Wall -mcall-prologues -mmcu=atmega328p linefollow.o -o linefollow.obj
says that there is an “undefined reference” to every command on every line


#2

Ideally, Google would have told you to look at my previous post about undefined references.

You need to add “-lpololu” in the linking step.

–David