Adding Pololu Library to Eclipse/AVR Studio

I was wondering if anyone has tried adding the Pololu library (for Orangutan’s and 3pi) to their WinAVR/Eclipse development enviroment?

I followed the instructions for adding the library AVR Studio. One major point the “Pololu 3pi User’s Guide” and “Pololu AVR C/C++ Library User’s Guide”, they are missing a couple of steps. After you have created a project, you need to click Project->Configuration Options on the menu bar. You will now see the Project Options window. Select the Include Directories icon. Once there, add in the include path to the pololu include folder. Next you’ll need to select the Libraries icon. Select libpololu.a and click the Add Library button. Finally just click ok. Now your programs will build if you use any of the Pololu Library includes. If you do not do this, when you build your program you will get many “undeclared references” errors. Basically, the compiler/linker does not know about the Pololu Library.

Currently I am using WinAVR 20080610, Eclipse 3.4, and the AVR Eclipse Plugin I have checked the Eclipse Wiki and the CDT/Users/FAQ. I tried what they said to do, but still have been unsuccessful in getting my programs to build. Has anyone else encountered this situation? By looking at the FAQ, it looks like what your told to do does not work for everyone.

Well, I didn’t mean for this to be long. I do hope the above section helps others who are having problems using the library with AVR Studio. Any help I can get with adding the library to Eclipse will be greatly apperciated.


The section on Using the Library in your own Projects explains how to add the library to your own projects. You shouldn’t have to add the pololu include folder to your include path if it is installed in the correct location, as a folder called “pololu” in the standard AVR include directory, and you use the line #include <pololu/orangutan.h> in your C files. However, the library file, libpololu.a, does need to get explicitly added to the project, and your instructions about that were correct.

I don’t know anything about Eclipse, but one thing that might help is that we provide a unix-style Makefile in each project directory for compiling the project. You might have to edit the paths to the compiler and linker to get it to work, but it Eclipse uses Makefiles, you could use that one.

Hello Paul,

Thanks for the reply. I tried what you mentioned about not having to add the include path. That works. So in AVR Studio all you have to do is add the libpololu.a.

As for Eclipse, I finally got it to work. I did many internet searches, and after compiling the information from many of them, I figured out what needs to be done. To help other people trying to do the same thing, I will explain what you need to do.

If your adding an external library to a WinAVR/Eclipse setup, there are several things you have to do. I will use the Pololu library as an example. First, add the include file with all the headers to C:\WinAVR-20080610\avr\include. Then you’ll add the libpololu.a file to C:\WinAVR-20080610\avr\lib. Once you have done that, you will need to open your project. Then on the menu bar click Project->Properties. On the left hand side there is a menu tree. Click on the arrow for C/C++ Build, and select Settings. Click the Tool Settings tab. Under AVR Compiler->Directories, click the Add icon for the Include Paths. Here you enter the path to the pololu include file C:\WinAVR-20080610\avr\include\pololu. Make sure you do this for both the Debug and Release Configurations. This is a small drop down menu above the Tool Settings tab. We are almost done. Now goto AVR Linker->Libraries. Click the Add icon for the Libraries and enter pololu. Again do this for both Debug and Release Configurations. Do not add this to Library Paths, as this will not work.

Once you have all of that complete, you can now use the Pololu library in you project. Remember, you will have to do these steps for each project where you want to use the Pololu library.

I hope this will help anyone else that is using the same development tools I am. As a side note, AVR Studio works, but I like the extra project management features of Eclipse. This just a personal preference, and you should use what works for you.


Thanks for the tip! I think that could be useful to a lot of people. Would it be okay with you if we quoted your instructions for Eclipse in our User’s Guide?


Hi Paul,

Yes, go right ahead. I think this will help many people who are developing AVR code in the Eclipse enviroment.

As of right now, my 3pi is running the basic line following Pololu provides in the examples. Next I am going to try the PID line following. I have to say the 3pi is a fun little robot.

Thanks again,