0

I am completely lost here, I have no idea what I am doing wrong. I am using Eclipse Mars using the Eclipse C++ Arduino extension. I am also using the COSA library, this is where the problem comes in. I can use all of the core COSA libraries but I can not figure out how to include the other libraries that are supplied with COSA specifically the ST7920.h file that is located in the libraries folder. Does anyone have any experience with this?

I have tried setting the path using the Project->C/C++ General->Preprocessor include paths and setting it there to no avail.

One thing that I am concerned about is in these separate libraries they are including files that are in other libs using only the header file, for example in the ST7920.hh file it has:

#include "Cosa/LCD.hh"
#include <HD44780.h>

I need to configure things so that the HD44780.h file needs to be found also. That file is located at "../HD44780/HD44780.h". How do I tell the compiler to search the "libraries" folder for files?

Also I tried to simply add the libraries folder as a linked folder in my project, that also did not work.

the only code I have is the #include and the compiler come back with that it can't find the file.

3
  • FWIW I have stopped using Eclipse Arduino plugin and replaced my whole environment with Netbeans 8 (note: I also use Cosa core and several of its libraries). Although it took me quite some time to configure from scratch, now I have a working setup that works just fine.
    – jfpoilpret
    Commented Jan 12, 2016 at 21:06
  • @jfpoilpret. Love Netbeans. How good is Arduino integration?
    – user31481
    Commented Feb 15, 2018 at 17:43
  • Netbeans integration was not straightforward but it worked well once done. I did not use any specific plugin for it.
    – jfpoilpret
    Commented Feb 17, 2018 at 8:21

2 Answers 2

1

I would advice to use the arduino eclipse plugin and not use the eclipse C++ arduino extension.

The eclipse C++ arduino extension is still very much in development.

The Arduino eclipse plugin has been around for years and contains far more features.

If you use V3 (that is still the nightly at the time of writing) you can use the boards manager and the cosa json file to import the cosa boards.

Importing a lib is a matter of typing

#include "libname"

and saving.

0

If you are using Linux I would recommend looking at the makefile based build script for Cosa (See Cosa/build). After configuration building from any IDE is more or less a simple command. No Makefile is required. The script cosa will do all the work.

$ cosa BOARD ACTION

such as

$ cosa uno avanti

which will build a sketch for Arduino Uno, upload and start a serial monitor. This can be used from any IDE. I use GNU Emacs, M-X compile (F2), with the command.

The way the Arduino pre-processor works each referenced library needs to be included in the sketch. For a sketch that uses ST7920:

#include <HD44780.h>
#include <ST7920.h>
4
  • I am on Windows not Linux, is there a Windows version of the script? It seems to me that I should be able to simply add the Libraries folder to Eclipse somewhere to point it to the right folder. Commented Dec 2, 2015 at 21:11
  • You should be able to configure Eclipse to add include paths for the necessary libraries. This is basically what the pre-processing in the Arduino build is doing (i.e. finding and adding include paths for the compiler). Commented Dec 2, 2015 at 21:15
  • Right that is my point exactly, I just don't know how this is done, everything that I have tried to link the libraries does not work, I have tried importing the entire libraries folder as a linked folder. I tried adding both the libraries folder and the ST7920 folder as include folders, library folders etc. Commented Dec 2, 2015 at 21:18
  • I tried to install the regular Arduino IDE and installed Cosa through the additional boards manager and the extra libraries were listed in the libraries. I was able to compile it through the Arduino IDE. Can you think of anything that I might be missing with Eclipse? This really sounds like a very good library and really want to get this working as it is perfect for my current project. Commented Dec 2, 2015 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.