User forums > Embedded development

How to link libraries


I'm working on a project involving an ATMEGA microcontroller and WS2812 LEDs, but I don't seem to be able to figure out how to include Adafruit_NeoPixel library -that I've downloaded from github- in my project. Can anybody please tell me how it is done?

Are you using the Arduino framework, or do you use only AVR gcc?
Can you give a link to the library?

What exactly is your problem? Can you describe it a bit in detail?

My guess is create an C++ Code::Block project then add the example/test code for the library to it.
Then I would add the library source files to the project starting with the C++ library and header files as needed to get rid of the build errors.

But, the above is only valid if you are using GCC directly instead of using an Arduino framework/build system.

If you are using an Arduino build system I would suggest asking on a website supporting the Arduino build system.

Tim S.

I'm using AVR GCC. I add every c and h file in the library (by right clicking on project, add files) and still get tons of strange errors. And it's not only this particular library, I can't seem to be able to include any other library made for Arduino. So my question is how arduino libraries in generall are used with CodeBlocks. Whats the correct way to include them. It seems there aren't many tutorials on the subject.

You need an C++ compiler to compile C++ files; that might be your problem. Please post a build log so it can be confirmed.

Tim S.


[0] Message Index

Go to full version