Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

java: symbol lookup error: undefined symbol: _ZN5gpiod4chipC1ERKSsi #22

Closed
fherrera124 opened this issue May 11, 2019 · 17 comments
Closed
Assignees
Labels
investigate Issues currently being investigated
Milestone

Comments

@fherrera124
Copy link

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

@ribasco
Copy link
Owner

ribasco commented May 12, 2019

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.

@fherrera124
Copy link
Author

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

@fherrera124
Copy link
Author

fherrera124 commented May 12, 2019

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?

@ribasco
Copy link
Owner

ribasco commented May 13, 2019

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)

@fherrera124
Copy link
Author

fherrera124 commented May 14, 2019

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+

@ribasco
Copy link
Owner

ribasco commented May 14, 2019

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

@fherrera124
Copy link
Author

Same result :/

@ribasco
Copy link
Owner

ribasco commented May 14, 2019

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

@fherrera124
Copy link
Author

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)

@ribasco ribasco self-assigned this May 15, 2019
@ribasco ribasco added the investigate Issues currently being investigated label May 15, 2019
@fherrera124
Copy link
Author

Can you reproduce this issue?

@fherrera124
Copy link
Author

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.

@fherrera124
Copy link
Author

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.

@ribasco
Copy link
Owner

ribasco commented May 17, 2019

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.

@fherrera124 fherrera124 changed the title Support for UserInterfaceSelectionList, UserInterfaceMessage and UserInterfaceInputValue java: symbol lookup error: /tmp/libucgdisp5742213074358605241.so: undefined symbol: _ZN5gpiod4chipC1ERKSsi May 19, 2019
@fherrera124 fherrera124 changed the title java: symbol lookup error: /tmp/libucgdisp5742213074358605241.so: undefined symbol: _ZN5gpiod4chipC1ERKSsi java: symbol lookup error: undefined symbol: _ZN5gpiod4chipC1ERKSsi May 19, 2019
@EliasGabrielsson
Copy link

EliasGabrielsson commented Sep 11, 2019

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.

@ribasco
Copy link
Owner

ribasco commented Nov 24, 2019

@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

@EliasGabrielsson
Copy link

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

@fherrera124
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
investigate Issues currently being investigated
Projects
None yet
Development

No branches or pull requests

3 participants