/usr/bin/ld: cannot find -llcd: No such file or directory

55 views Asked by At

I try to compile program for LCD on Raspberry Pi but I get these errors:

/usr/bin/ld: cannot find -llcd: No such file or directory
collect2: error: ld returned 1 exit status
#include <iostream>
#include <wiringPi.h>
#include <wiringPiI2C.h>
#include <lcd.h>
#include <chrono>
#include <thread>

int main()
{
    int lcd;
    int lcd_addr = 0x3c;
    wiringPiSetup();
    lcd = wiringPiI2CSetup(lcd_addr);

    if (lcd < 0) {
        std::cerr << "LCD initialization failed!" << std::endl;
        return 1;
    }
    lcdClear(lcd);
    lcdPosition(lcd, 0, 0);
    lcdPuts(lcd, "Hello, LCD!");

    std::this_thread::sleep_for(std::chrono::seconds(2));

    lcdClear(lcd);
    lcdPosition(lcd, 0, 0);
    lcdPuts(lcd, "bb");

    std::this_thread::sleep_for(std::chrono::seconds(2));

I tried to reinstall wiringPi and lcdproc but nothing changed.

0

There are 0 answers