Go Down

Topic: Problems with includes using Eclipse as IDE (Read 5275 times) previous topic - next topic



I am trying to use my Arduino with the Eclipse IDE but somehow I am not able to use the command #include <LiquidCrystal.h>

A simple example like Blink works just fine, but if I try to compile the following little code, I got an error.
Code: [Select]

#include "WProgram.h"

#include <LiquidCrystal.h>

int main(void) {

  /* Must call init for arduino to work properly */

  /* Add your setup code here */
  pinMode(13, OUTPUT);
  LiquidCrystal lcd(7, 5, 4, 3, 2, 1);

  for (;;) {

    /*** write main loop here ***/
digitalWrite(13, HIGH);   // set the LED on
delay(200);              // wait for a second
digitalWrite(13, LOW);    // set the LED off
delay(200);              // wait for a second

  } // end for

} // end main

As Error I get
expected '=', ',', ';', 'asm' or '__attribute__' before 'lcd'

Has anyone any idea what is going on?


From looking at the syntax for LiquidCrystal() it looks like your line should be:

LiquidCrystal(7, 5, 4, 3, 2, 1);

instead of:

LiquidCrystal lcd(7, 5, 4, 3, 2, 1);


Nope, this should be correct. Works fine with the Arduino IDE tough...

Any other idea?


is the file main.c or main.cpp ? My first though was that it looks like the errors I get if I try to compile a C++ file with the C compiler.

If that's not it someone more familiar will have to help you out.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131