Skip to main content
Tweeted twitter.com/#!/StackArduino/status/584675561047511040
simplified
Source Link
Thomas S.
  • 566
  • 3
  • 8
  • 22

I have following code:

MyApp.ino:

#include "DfRobotLcdShield.h"

void setup() {
}

void loop() {
}

DfRobotLcdShield.h:

#ifndef _DF_ROBOT_LCD_SHIELD_H
#define _DF_ROBOT_LCD_SHIELD_H

#include <LiquidCrystal.h>

extern LiquidCrystal lcd;

#endif // _DF_ROBOT_LCD_SHIELD_H

DfRobotLcdShield.cpp:

#include "DfRobotLcdShield.h"

// initialize the library with the numbers of the interface pins
// RS = 8
// EN = 9
// RW = GND
// D4 = 10
// D5 = 5
// D6 = 6
// D7 = 7
LiquidCrystal lcd(8, 9, 10, 5, 6, 7);

When I try to compile, I'm getting the error:

In file included from MyApp.ino:1:0:
c:\temp\build5856181074637812172.tmp\DfRobotLcdShield.h:4:27: fatal error: LiquidCrystal.h: No such file or directory
 #include <LiquidCrystal.h>
                           ^
compilation terminated.
Error compiling.

When I add

#include <LiquidCrystal.h>

directly to the .ino file, it works. I'm using the latest Arduino-IDE 1.6.3.

I have following code:

MyApp.ino:

#include "DfRobotLcdShield.h"

void setup() {
}

void loop() {
}

DfRobotLcdShield.h:

#ifndef _DF_ROBOT_LCD_SHIELD_H
#define _DF_ROBOT_LCD_SHIELD_H

#include <LiquidCrystal.h>

extern LiquidCrystal lcd;

#endif // _DF_ROBOT_LCD_SHIELD_H

DfRobotLcdShield.cpp:

#include "DfRobotLcdShield.h"

// initialize the library with the numbers of the interface pins
// RS = 8
// EN = 9
// RW = GND
// D4 = 10
// D5 = 5
// D6 = 6
// D7 = 7
LiquidCrystal lcd(8, 9, 10, 5, 6, 7);

When I try to compile, I'm getting the error:

In file included from MyApp.ino:1:0:
c:\temp\build5856181074637812172.tmp\DfRobotLcdShield.h:4:27: fatal error: LiquidCrystal.h: No such file or directory
 #include <LiquidCrystal.h>
                       ^
compilation terminated.
Error compiling.

When I add

#include <LiquidCrystal.h>

directly to the .ino file, it works. I'm using the latest Arduino-IDE 1.6.3.

I have following code:

MyApp.ino:

#include "DfRobotLcdShield.h"

void setup() {
}

void loop() {
}

DfRobotLcdShield.h:

#include <LiquidCrystal.h>

When I try to compile, I'm getting the error:

In file included from MyApp.ino:1:0:
c:\temp\build5856181074637812172.tmp\DfRobotLcdShield.h:4:27: fatal error: LiquidCrystal.h: No such file or directory
 #include <LiquidCrystal.h>
                           ^
compilation terminated.
Error compiling.

When I add

#include <LiquidCrystal.h>

directly to the .ino file, it works. I'm using the latest Arduino-IDE 1.6.3.

edited title
Link
Thomas S.
  • 566
  • 3
  • 8
  • 22

Problem importing a library in .h file

Source Link
Thomas S.
  • 566
  • 3
  • 8
  • 22

Problem importing a library

I have following code:

MyApp.ino:

#include "DfRobotLcdShield.h"

void setup() {
}

void loop() {
}

DfRobotLcdShield.h:

#ifndef _DF_ROBOT_LCD_SHIELD_H
#define _DF_ROBOT_LCD_SHIELD_H

#include <LiquidCrystal.h>

extern LiquidCrystal lcd;

#endif // _DF_ROBOT_LCD_SHIELD_H

DfRobotLcdShield.cpp:

#include "DfRobotLcdShield.h"

// initialize the library with the numbers of the interface pins
// RS = 8
// EN = 9
// RW = GND
// D4 = 10
// D5 = 5
// D6 = 6
// D7 = 7
LiquidCrystal lcd(8, 9, 10, 5, 6, 7);

When I try to compile, I'm getting the error:

In file included from MyApp.ino:1:0:
c:\temp\build5856181074637812172.tmp\DfRobotLcdShield.h:4:27: fatal error: LiquidCrystal.h: No such file or directory
 #include <LiquidCrystal.h>
                       ^
compilation terminated.
Error compiling.

When I add

#include <LiquidCrystal.h>

directly to the .ino file, it works. I'm using the latest Arduino-IDE 1.6.3.