Forum >#include path issues
ArduinoGeneral

#include path issues

userHead rlabatt 2011-05-30 05:04:41 8471 Views3 Replies
Hi All,

Bit of a newbie issue here. I am trying to get the LCD1602 helloworld example to compile on my Mac (OSX 10.6.7) and keep getting this compile error:

[font=courier]liquidCrystal_helloworld.cpp:6:31: error: LiquidCrystal_I2C.h: No such file or directory
liquidCrystal_helloworld:7: error: 'LiquidCrystal_I2C' does not name a type[/font]

I have checked that LiquidCrystal_I2C.h and LiquidCrystal_I2C.cpp are in the correct directories for includes. More specifically, they are in:
[font=courier]<arduino>/libraries/LiquidCrystal_I2C/
<arduino>/hardware/tools/acr/acr/include/
~/documents/ardunio/libraries/[/font]

These are the paths recommended on arduino.cc and cited in the preferences.txt file for Arduino
"[font=courier]sketchbook.path=/Users/ptoserver/Dropbox/rlabatt/arduino[/font]"

Finally, I have checked the spelling of the file names and it is the same.

Could it be that the Arduino interface does not like dropbox? I'll test that next, but there are other #include files that are not causing errors so I am skeptical that this is the case.

I am at a loss and could really use a second set of eyes on this. Thanks in advance for any assistance you may be able to provide.


2011-05-31 19:42:33 Hi rlabatt,

I have loaded the library and code to my PC and it works fine. I would assume it is a problem of where you are storing your files on your MAC. Unfortunately I do not have a mac on hand to test this with.

I will do my best to explain how these files should be stored.

On my PC the Arduino IDE is In C:\Arduino-0022\

In side this directory there should be a libraries folder. You should place the "LiquidCrystal_I2C" folder in this directory. Like so:

C:\arduino-0022\libraries\LiquidCrystal_I2C\

Inside the only thing that NEEDS to be there is the LiquidCrystal_I2C.h, LiquidCrystal_I2C.cpp, and the LiquidCrystal_I2C.o  files.

The example codes you can place in your Sketch folder.  Each in its own folder.

I don't think you need to place anything in the C:\arduino-0022\hardware\tools\avr\avr\include folder. This folder is for essential libraries.

Another recommendation I could give you is to try clicking on the "sketch" menu option on the Arduino IDE tool bar. then "Import Library" In this menu you should see which libraries are available to you. If the LiquidCrystal_I2C library does not appear as an option then it is not properly installed.

I don't think the sketch being stored on dropbox should affect you, so long as the libraries are stored on the local drive.

Hope this helps, otherwise let us know.

-Hector
userHeadPic Hector
2011-05-30 19:29:18 Thanks Hector

I am using Ardunio-0022, which is the latest version on the Arduino.cc web site.  The code I am using for this initial hello world project is the DFRobot sample code for the LCD1602.  I have not changed a thing.  Here is the code in its entirety:

[code]///Arduino Sample Code
///www.DFRobot.com
///Last modified on 17th September 2010

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd
 
  // Print a message to the LCD.
  lcd.backlight();
  //lcd.setCursor(0, 1);
  lcd.print("Hello, world!");
}

void loop()
{
  // when characters arrive over the serial port...
  if (Serial.available()) {
    // wait a bit for the entire message to arrive
    delay(100);
    // clear the screen
    lcd.clear();
    // read all the available characters
    while (Serial.available() > 0) {
      // display each character to the LCD
      lcd.write(Serial.read());
    }
  }
}[/code]

As you can see, the include line is [font=courier]#include LiquidCrystal_I2C.[/font]h, which I can only assume is specific to the DFRobot 1602 display and driver. 

Am I off base? 

Thank you as well for the Syncplicity suggestion.
userHeadPic rlabatt
2011-05-30 18:15:13 Hi Rlabatt,


There are a couple of issues here.

1. The include file should be:
#include <LiquidCrystal.h>

and not: liquidCrystal_[b][i]helloworld[/i][/b].h


I'm not sure why you have an include file named liquidCrystal_helloworld.h?

Are you using the newest IDE version?

2. What do you mean: "Could it be that the Arduino interface does not like dropbox? "

You have the IDE, and libraries in your dropbox? You should try to place the IDE and its associated files on your drive in its traditional path. You could just keep your Sketches in dropbox while the rest is on your drive. Also, if you absolutely must keep your IDE synced, try using Syncplicity, its a similar service to dropbox, but allows you to choose which folders are synced.

userHeadPic Hector