aREST icon indicating copy to clipboard operation
aREST copied to clipboard

How to use aREST library in Eclipse projects?

Open SalvaPedraza opened this issue 8 years ago • 2 comments

I am developing for ESP32 development board. I am using Eclipse IDE. I have tried to import aREST.h in my projects but fail due to dependencies with other Arduino IDE modules. How can I use aREST in my Eclipse projects?

SalvaPedraza avatar Nov 22 '17 14:11 SalvaPedraza

Hi, I'll mark that as a question as I never used Eclipse, but maybe somebody else has an answer. For sure I can confirm it works with the Arduino IDE & PlatformIO :)

marcoschwartz avatar Nov 27 '17 18:11 marcoschwartz

I had no problem using it in Eclipse...

Just import the library like any other ESP-IDF Eclipse project libraries, using Components (see https://esp-idf.readthedocs.io/en/v1.0/build_system.html)

Simplified steps:

  1. In your Eclipse project create "components/aRest/include" folders and "components/aRest/component.mk" file.

  2. Place aREST.h library file inside "components/aRest/include" folder.

  3. Link "include" sub-folder to the component structure by adding next text to component.mk file:

#
# Component Makefile
#
# This Makefile should, at the very least, just include $(SDK_PATH)/make/component.mk. By default,
# this will take the sources in this directory, compile them and link them into
# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
# please read the SDK documents if you need to do this.
#

COMPONENT_ADD_INCLUDEDIRS := include
  • Note the Arduino IDE has some preprocessor defines to specify witch board are you using, and aREST library use them to determine the device (i.e: AVR_ATmega328P, AVR_ATmega2560, ADAFRUIT_CC3000_H, ESP8266, ESP32). So you need to create the ESP32 define in some place for tell the library to use ESP32 parameters: #define ESP32 1

J-Rios avatar Dec 20 '17 12:12 J-Rios