ribasco / ucgdisplay

A character/graphics lcd library for single board computers (e.g. Raspberry Pi) written in Java. Provides drivers for graphics monochrome display devices (lcd, oled, e-ink etc) powered by U8g2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java: symbol lookup error: undefined symbol: _ZN5gpiod4chipC1ERKSsi

fherrera124 opened this issue · comments

Hi, nice piece of work. I would like to create a menu and ask for some input to the user. Thanks in advance.

I left this out intentionally as I believe it should be a part of a separate higher level UI toolkit/framework built on top of this library. I have already started the development on the UI toolkit, just didn't have enough time to complete the development.

You can check out the LcdMenu on the development branch to get some ideas on how to implement a Menu system of your own.

Thanks, I'll give a try with my st7920 lcd.

Trying to run the example code for st7920 lcd I'm getting the error: Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libucgdisp1701098975227377638.so: libgpiodcxx.so.1: cannot open shared object file: No such file or directory.
I have already installed libgpiod, any ideas of what could be wrong or missing?

Looks like its not able to find the native library, can you provide more information about the environment you are running the code from? (e.g. SBC model, linux kernel version, libgpiod version, java jdk etc)

I'm running the code in Raspbian, I managed to solve the error, I forgotten to add the c++ bindings when compiling libgpiod. But now when trying to run the example code I'm getting:

java: symbol lookup error: /tmp/libucgdisp5742213074358605241.so: undefined symbol: _ZN5gpiod4chipC1ERKSsi

I don't know what that means. Did I compile libgpiod the right way?:

~/libgpiod-1.3 $ ./autogen.sh --enable-tools=yes --enable-bindings-cxx --prefix=/usr/local --host=arm-linux-gnueabihf CFLAGS="-I/usr/src/linux-headers-$(uname -r)/include/uapi -I/usr/src/linux-headers-$(uname -r)/include -Iinclude -fPIC" ac_cv_func_malloc_0_nonnull=yes

java version "1.8.0_201"
kernel version 4.14.98-v7+

Can you try to use v1.2 of libgpiod, see if that works

Same result :/

Can you post the output of ldd /tmp/libucgdisp*.so

Here is the output:

    linux-vdso.so.1 (0x7edb8000)
    /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x7661a000)
    libgpiod.so.2 => /usr/local/lib/libgpiod.so.2 (0x76602000)
    libgpiodcxx.so.1 => /usr/local/lib/libgpiodcxx.so.1 (0x765e5000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x7649d000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7641e000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x763f1000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x762b2000)
    /lib/ld-linux-armhf.so.3 (0x76f90000)

Can you reproduce this issue?

Sorry to bother you, after running successfully mvn install, what would be the right command to run the st7920 example? I'm having problems with maven not finding arm libraries.

Nevermind, got it working with the command:

mvn exec:java -pl examples/drivers/glcd -Dexec.mainClass="com.ibasco.ucgdisplay.examples.glcd.GlcdST7920Example"

Altough I still cannot use the imported repository from maven.

Sorry for the delay, i'm still in the process of re-building my dev environment (something screwed up) and might take some time. I will post an update once I get everything up and running, see if I am able to re-produce this issue.

I was trying out your project as it looked promising. I though stumbled upon the same error as @elganzua124 have experienced.

Error symptom: /usr/bin/java: symbol lookup error: /tmp/libucgdisp1131636424129721253.so: undefined symbol: _ZN5gpiod4chipC1ERKSsi

Output of ldd /tmp/libucgdisp*.so:

	linux-vdso.so.1 (0xbefdf000)
	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6623000)
	libgpiod.so.2 => /usr/local/lib/libgpiod.so.2 (0xb65f6000)
	libgpiodcxx.so.1 => /usr/local/lib/libgpiodcxx.so.1 (0xb65d9000)
	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6492000)
	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6410000)
	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb63e3000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6295000)
	/lib/ld-linux-armhf.so.3 (0xb6f98000)

Tried with: libgpiod version: commit 1f0d078c83643352a8d2bd1b947f29b44406088e ~1.4.x and tag v1.2. The compilation of libgpiod was configured with: ./autogen.sh --enable-tools=yes --enable-bindings-cxx --prefix=/usr/local

The display controller used is an SDD1309. Configured as following:

        GlcdPinMapConfig RPi = new GlcdPinMapConfig()
                .map(GlcdPin.SPI_CLOCK, 14)
                .map(GlcdPin.SPI_MOSI, 12)
                .map(GlcdPin.RESET, 6)
                .map(GlcdPin.DC, 5)
                .map(GlcdPin.CS, 10);

        System.out.println( "Hello World!" );
        GlcdConfig config = GlcdConfigBuilder.create()
                .rotation(GlcdRotation.ROTATION_NONE)
                .busInterface(GlcdBusInterface.SPI_HW_4WIRE)
                .transportDevice("/dev/spidev0.0")
                .gpioDevice("/dev/gpiochip0")
                .display(Glcd.SSD1309.D_128x64_NONAME0)
                .pinMap(RPi)
                .build();
        GlcdDriver driver = new GlcdDriver(config);
        driver.setCursor(0, 10);
        driver.setFont(GlcdFont.FONT_6X12_MR);
        driver.clearBuffer();
        driver.drawString("Hello World");
        driver.sendBuffer();

The hardware is a Raspberry Pi 4.

@elganzua124, @EliasGabrielsson I have made the necessary changes that should fix the issues you previously encountered (latest version is 1.5.2-alpha). In your spare time, could you run another test to confirm if everything is working on your end? Appreciate any feedback

Hi Rafael!
I will give it a go during the holiday and post the results 👍

Hi, just tested the GlcdST7920HWExample.java example. I can confirm that the issue was solved. Thanks.