# Lcd.print() won't work

**URL:** <https://forum.arduino.cc/t/lcd-print-wont-work/910417>\
**Category:** Programming\
**Created:** [September 30, 2021, 12:20pm UTC](https://forum.arduino.cc/t/lcd-print-wont-work/910417 "2021-09-30T12:20:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![huhq](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@huhq](https://forum.arduino.cc/u/huhq)\
**Post date:** [September 30, 2021, 12:20pm UTC](https://forum.arduino.cc/t/lcd-print-wont-work/910417/1 "2021-09-30T12:20:20Z")

</div>

Hi, I am having the problem that I can't print out a string variable using the lcd.  
I never had a problem with this and the solution seems to be so simple, but I can't find it. I hope somebody has an idea.  
Error Message in German: "Keine Instanz von Überladene Funktion "LiquidCrystal\_I2C::print" stimmt mit der Argumentliste überein. -- Argumenttypen sind: (std::\_\_cxx11::string) -- Der Objekttyp ist: LiquidCrystal\_I2C",

-\>translated via google translate into English: No instance of Overloaded Function \ "LiquidCrystal\_I2C :: print " matches the argument list. - Argument types are: (std :: \_\_ cxx11 :: string) - The object type is: LiquidCrystal\_I2C

Here is my Code:

#include \<LiquidCrystal\_I2C.h\>  
#include string // isn't shown on this forum, so I wrote it without the two symbols

class Window  
{  
public:  
string Line1;  
string Line2;

```
void setLines(string line1, string line2) {
    Line1 = line1;
    Line2 = line2;
}

string getLines()
{
    return Line1 + Line2;    
}

void printOnLcd()
{
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(Line1); // HERE IS THE ERROR
  lcd.setCursor(0,1);
  lcd.print(Line2); //HERE IS THE ERROR
}

```

};

 ![Screenshot (5)](https://europe1.discourse-cdn.com/arduino/original/4X/6/1/a/61a4fea45dcea7feb5a86c91704bc37e9e261fc8.png)

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [September 30, 2021, 12:39pm UTC](https://forum.arduino.cc/t/lcd-print-wont-work/910417/2 "2021-09-30T12:39:42Z")

</div>

Try String (capital S).

---

<div class="post-metadata">

**Author:** ![huhq](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@huhq](https://forum.arduino.cc/u/huhq)\
**Post date:** [September 30, 2021, 12:45pm UTC](https://forum.arduino.cc/t/lcd-print-wont-work/910417/3 "2021-09-30T12:45:05Z")

</div>

This solved my issue! Many thanks. However, it also created another error: In the method getLines() the two Strings can't be added together anymore. Do you know how to do that? Thanks again for your very helpful answer!  
SOLUTION: I wrote string again in front of the method, it should instead have been String

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [September 30, 2021, 12:47pm UTC](https://forum.arduino.cc/t/lcd-print-wont-work/910417/4 "2021-09-30T12:47:58Z")

</div>

> [@huhq](#):
>
> I wrote string again in front of the method, it should instead have been String

😂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 29, 2022, 12:48pm UTC](https://forum.arduino.cc/t/lcd-print-wont-work/910417/5 "2022-03-29T12:48:25Z")

</div>

Closed on March 29, 2022, 12:48pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
