News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to link libraries

Started by zhezhoo, March 16, 2022, 11:02:08 PM

Previous topic - Next topic

zhezhoo

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?

BlueHazzard

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?

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

zhezhoo

#3
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.

stahta01

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

https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]