lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
356 stars 51 forks source link

error: use of undeclared identifier 'I2C_SLAVE' #98

Open SegFault42 opened 1 year ago

SegFault42 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce 1) Download the 1.1.4 2) make library

Expected behavior The libray should compile

➜  lcdgfx-1.1.4 make library
mkdir -p /tmp/test1/lcdgfx-1.1.4/bld
make -C ./src/ -f Makefile.linux SDL_EMULATION=n EXTRA_CPPFLAGS="" BLD=/tmp/test1/lcdgfx-1.1.4/bld
cc  -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o v2/utf8.o v2/utf8.c
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/avr/platform.o lcd_hal/avr/platform.cpp
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/avr/i2c_twi.o lcd_hal/avr/i2c_twi.cpp
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/avr/spi_avr.o lcd_hal/avr/spi_avr.cpp
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/avr/i2c_embedded.o lcd_hal/avr/i2c_embedded.cpp
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/avr/spi_usi.o lcd_hal/avr/spi_usi.cpp
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/linux/platform.o lcd_hal/linux/platform.cpp
c++ -std=c++11 -I. -I./v2  -MD -g -Os -Wall -Werror -ffunction-sections -fdata-sections   -c -o lcd_hal/linux/linux_i2c.o lcd_hal/linux/linux_i2c.cpp
lcd_hal/linux/linux_i2c.cpp:75:22: error: use of undeclared identifier 'I2C_SLAVE'
    if ( ioctl(m_fd, I2C_SLAVE, m_sa) < 0 )
                     ^
1 error generated.
make[1]: *** [lcd_hal/linux/linux_i2c.o] Error 1
lexus2k commented 1 year ago

Are you compiling the library for Linux platform? I have compiled the library for Ubuntu 20.04, and no issues are observed so far.