Trico-Everfire / p2-publishing-tool

MIT License
15 stars 2 forks source link

Linux: libsteam_api.so: cannot open shared object file: No such file or directory #6

Closed ghost closed 2 years ago

ghost commented 2 years ago

In Linux, when trying to execute the binary in the extracted folder give the error message: ./p2_map_publisher: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory the ls in the folder of the binary:

Credits.txt
libQt5Core.so
libQt5Gui.so
libQt5Network.so
libQt5Widgets.so
libsteam_api.so
p2_map_publisher
Trico-Everfire commented 2 years ago

Question, what distro of linux are you running? Even when installing the release it sees all files.

ghost commented 2 years ago

OpenSUSE Leap 15.3 What are you referring with "Even when installing the release it sees all files"?

Trico-Everfire commented 2 years ago

OpenSUSE Leap 15.3 What are you referring with "Even when installing the release it sees all files"?

I myself run Linux, kde neon plasma, when I install the tool from zip and unpack, it works. I will see if I can replicate this on a fresh install when I get the chance. Make sure you have the latest install and make sure all DLLs are in the folder with the executable, who has been marked as executable.

ghost commented 2 years ago

For replicate this bug I made this script.

#!/usr/bin/bash -e

echo Downloading
curl -Lo p2-publishing-tool-linux-release.zip https://github.com/Trico-Everfire/p2-publishing-tool/releases/download/v0.2.0-alpha/p2-publishing-tool-linux-release.zip
echo Downloaded

echo Unziping
unzip p2-publishing-tool-linux-release.zip
echo Unzipped

echo Enabling execution
chmod +x p2_map_publisher
echo Execution is enabled

echo Runnig p2_map_publisher
./p2_map_publisher

I am executing it at /home/\<insert username>/Downloads/test. And it gives me the following output

Downloading
Downloaded
Unziping
Archive:  p2-publishing-tool-linux-release.zip
  inflating: p2_map_publisher        
  inflating: libsteam_api.so         
  inflating: libQt5Widgets.so        
  inflating: libQt5Network.so        
  inflating: libQt5Gui.so            
  inflating: libQt5Core.so           
  inflating: Credits.txt             
Unzipped
Enabling execution
Execution is enabled
Runnig p2_map_publisher
./p2_map_publisher: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory
Trico-Everfire commented 2 years ago

I figured out that it doesn't link the libraries properly, I'll fix this asap.

Trico-Everfire commented 2 years ago

For replicate this bug I made this script.

#!/usr/bin/bash -e

echo Downloading
curl -Lo p2-publishing-tool-linux-release.zip https://github.com/Trico-Everfire/p2-publishing-tool/releases/download/v0.2.0-alpha/p2-publishing-tool-linux-release.zip
echo Downloaded

echo Unziping
unzip p2-publishing-tool-linux-release.zip
echo Unzipped

echo Enabling execution
chmod +x p2_map_publisher
echo Execution is enabled

echo Runnig p2_map_publisher
./p2_map_publisher

I am executing it at /home//Downloads/test. And it gives me the following output

Downloading
Downloaded
Unziping
Archive:  p2-publishing-tool-linux-release.zip
  inflating: p2_map_publisher        
  inflating: libsteam_api.so         
  inflating: libQt5Widgets.so        
  inflating: libQt5Network.so        
  inflating: libQt5Gui.so            
  inflating: libQt5Core.so           
  inflating: Credits.txt             
Unzipped
Enabling execution
Execution is enabled
Runnig p2_map_publisher
./p2_map_publisher: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory

Can you attempt the newest release: https://github.com/Trico-Everfire/p2-publishing-tool/releases/tag/v0.2.2-alpha

it should fix the issues you have. if not, tell me ASAP.

ghost commented 2 years ago

No sure if the problem may still exist after this other one: ./p2_map_publisher: /usr/lib64/libQt5Core.so.5: version `Qt_5.15' not found (required by ./p2_map_publisher) This is actually another bug?. Clearly is trying to load system-wide libraries instead of the ones you provided.

ghost commented 2 years ago

@Trico-Everfire No sure if the problem may still exist after this other one: ./p2_map_publisher: /usr/lib64/libQt5Core.so.5: version `Qt_5.15' not found (required by ./p2_map_publisher) This is actually another bug?. Clearly is trying to load system-wide libraries instead of the ones you provided.

Trico-Everfire commented 2 years ago

@Trico-Everfire No sure if the problem may still exist after this other one: ./p2_map_publisher: /usr/lib64/libQt5Core.so.5: version `Qt_5.15' not found (required by ./p2_map_publisher) This is actually another bug?. Clearly is trying to load system-wide libraries instead of the ones you provided.

@Bohmthedudevulture it's odd, I'll have to look into it, It seems like that for whatever reason it tries to look for global libs, which it shouldn't.

ghost commented 2 years ago

Executing ldd in your executable gives me the following after striping removing information that potentially can be used for identification.

./p2_map_publisher: /usr/lib64/libQt5Core.so.5: version `Qt_5.15' not found (required by ./p2_map_publisher)
        linux-vdso.so
        libQt5Widgets.so.5 => /usr/lib64/libQt5Widgets.so
        libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so
        libQt5Network.so.5 => /usr/lib64/libQt5Network.so
        libsteam_api.so => /home/alfredo/Downloads/trico/./libsteam_api.so
        libQt5Core.so.5 => /usr/lib64/libQt5Core.so
        libstdc++.so.6 => /usr/lib64/libstdc++.so
        libgcc_s.so.1 => /lib64/libgcc_s.so
        libc.so.6 => /lib64/libc.so
        libpthread.so.0 => /lib64/libpthread.so
        libm.so.6 => /lib64/libm.so
        libGL.so.1 => /usr/lib64/libGL.so
        libpng16.so.16 => /usr/lib64/libpng16.so
        libz.so.1 => /lib64/libz.so
        libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so
        libdl.so.2 => /lib64/libdl.so
        libproxy.so.1 => /usr/lib64/libproxy.so
        libssl.so.1.1 => /usr/lib64/libssl.so
        libcrypto.so.1.1 => /usr/lib64/libcrypto.so
        /lib64/ld-linux-x86-64.so
        libsystemd.so.0 => /usr/lib64/libsystemd.so
        libicui18n.so.suse65.1 => /usr/lib64/libicui18n.so
        libicuuc.so.suse65.1 => /usr/lib64/libicuuc.so
        libpcre2-16.so.0 => /usr/lib64/libpcre2-16.so
        libdouble-conversion.so.3 => /usr/lib64/libdouble-conversion.so
        libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so
        libGLX.so.0 => /usr/lib64/libGLX.so
        libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so
        libfreetype.so.6 => /usr/lib64/libfreetype.so
        libgraphite2.so.3 => /usr/lib64/libgraphite2.so
        libmodman.so.1 => /usr/lib64/libmodman.so
        librt.so.1 => /lib64/librt.so
        liblzma.so.5 => /usr/lib64/liblzma.so
        libzstd.so.1 => /usr/lib64/libzstd.so
        liblz4.so.1 => /usr/lib64/liblz4.so
        libcap.so.2 => /usr/lib64/libcap.so
        libselinux.so.1 => /lib64/libselinux.so
        libgcrypt.so.20 => /usr/lib64/libgcrypt.so
        libicudata.so.suse65.1 => /usr/lib64/libicudata.so
        libpcre.so.1 => /usr/lib64/libpcre.so
        libX11.so.6 => /usr/lib64/libX11.so
        libbz2.so.1 => /usr/lib64/libbz2.so
        libgpg-error.so.0 => /usr/lib64/libgpg-error.so
        libxcb.so.1 => /usr/lib64/libxcb.so
        libXau.so.6 => /usr/lib64/libXau.so

End the command readelf -d p2_map_publisher gives me:

  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libQt5Widgets.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libQt5Gui.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libQt5Network.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libsteam_api.so]
 0x0000000000000001 (NEEDED)             Shared library: [libQt5Core.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN]
 0x000000000000000c (INIT)               0xa000
 0x000000000000000d (FINI)               0x25d08
 0x0000000000000019 (INIT_ARRAY)         0x28cc00
 0x000000000000001b (INIT_ARRAYSZ)       24 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x28cc18
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x3a0
 0x0000000000000005 (STRTAB)             0x26b8
 0x0000000000000006 (SYMTAB)             0x3f0
 0x000000000000000a (STRSZ)              13834 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x28d688
 0x0000000000000002 (PLTRELSZ)           6792 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x77b8
 0x0000000000000007 (RELA)               0x60d8
 0x0000000000000008 (RELASZ)             5856 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW PIE
 0x000000006ffffffe (VERNEED)            0x5fa8
 0x000000006fffffff (VERNEEDNUM)         7
 0x000000006ffffff0 (VERSYM)             0x5cc2
 0x000000006ffffff9 (RELACOUNT)          92
 0x0000000000000000 (NULL)               0x0
ghost commented 2 years ago

@Trico-Everfire The eror changes for ./p2_map_publisher: error while loading shared libraries: libicui18n.so.56: cannot open shared object file: No such file or directory after run mv libQt5Core.so.5.15.2 libQt5Core.so.5. This looks like the library is searching for the incorrect name in the search phase, probably it would still solve the problem with the other libraries, but before confirming someone have to fix this new error message.

ghost commented 2 years ago

@Trico-Everfire I am pretty sure that you need to solve ship a copy of libicui18n.so.56 in your build.

ghost commented 2 years ago

I made a symbolic link for the missing libicui18n.so.56, libicuuc.so.56, and libicudata.so.56. And change the name of the shipped libraries striping them of the last numbers afer the 5. And I resolves all the problems, except for the fact that the version of libicui18n.so.56, libicuuc.so.56, and `libicudata.so.56, aren't the correct ones, thus it does not run.

ghost commented 2 years ago

@Trico-Everfire I take the opportunity of test my recommendations with a freshly compiled version of lib ICU from github.com/unicode-org/icu and the result is this new error: qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" by the recommendation of this stackoverflow https://stackoverflow.com/questions/62391587/qt-could-not-find-the-qt-platform-plugin-xcb it most likely have to do with the Qt libraries that you are shiping do no include the Qt xbc extension.

Trico-Everfire commented 2 years ago

@Bohmthedudevulture This has been resolved! Thank you for waiting. gcc_64 I'll close this issue with this comment, if issues arise, please be sure to reopen this issue.