Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: - libcrypto.so.1.1: cannot open shared object file: No such file or directory #1274

Open
driftywinds opened this issue Oct 31, 2022 · 27 comments
Labels
terminal Related to terminal app

Comments

@driftywinds
Copy link

This is what it says when I try to open it up in the terminal

@avently
Copy link
Collaborator

avently commented Nov 2, 2022

Looks like you:

  • don't have openssl installed -> install it via a package manager of your OS (on Ubuntu it's sudo apt install libssl-dev)
  • don't have specific version of openssl installed (1.1) -> probably, nothing you can do if your OS doesn't have a 1.1 version
  • don't have a symlink (libcrypto.so.1.1 to libcrypto.so) -> you can try to create a symlink yourself, like (in Ubuntu x64) sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1. Make sure the paths are correct in your OS.
    And then try to launch it again.

@kseistrup
Copy link

kseistrup commented Nov 7, 2022

Many distros have upgraded OpenSSL from v1.* to v3.0.7, so the library is now libcrypto.so.3.

@solus-hq
Copy link
Contributor

solus-hq commented Nov 14, 2022

/o/homebrew/o/o/lib stable ❱ simplex-chat
dyld[87295]: Library not loaded: '/usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib'
  Referenced from: '/Users/fire/.local/bin/simplex-chat'
  Reason: tried: '/usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libcrypto.1.1.dylib' (no such file), '/usr/lib/libcrypto.1.1.dylib' (no such file), '/opt/homebrew/Cellar/openssl@1.1/1.1.1s/lib/libcrypto.1.1.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libcrypto.1.1.dylib' (no such file), '/usr/lib/libcrypto.1.1.dylib' (no such file)
fish: Job 1, 'simplex-chat' terminated by signal SIGABRT (Abort)

It's not working for ARM (M1)...

@epoberezkin

@epoberezkin
Copy link
Member

The problem is that the binary in GitHub is compiled for Intel (GitHub doesn’t have M1 runners I think) and libcrypto you have installed is most likely for M1… A quick solution is to compile from source on M1, we might include libcrypto in the binary at some point though.

@solus-hq
Copy link
Contributor

solus-hq commented Nov 14, 2022

The problem is that the binary in GitHub is compiled for Intel (GitHub doesn’t have M1 runners I think) and libcrypto you have installed is most likely for M1… A quick solution is to compile from source on M1, we might include libcrypto in the binary at some point though.

GHCup was kind enough to install everything for me, I was just asked to add LLVM@13 during compilation but at some point something went wrong with the compile process:

Progress 22/114

--  While building package direct-sqlcipher-2.3.27 (scroll up to its section to see the error) using:
      /Users/fire/.stack/setup-exe-cache/aarch64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --verbose=1 --builddir=.stack-work/dist/aarch64-osx/Cabal-3.2.1.0 configure --with-ghc=/Users/fire/.stack/programs/aarch64-osx/ghc-8.10.7/bin/ghc-8.10.7 --with-ghc-pkg=/Users/fire/.stack/programs/aarch64-osx/ghc-8.10.7/bin/ghc-pkg-8.10.7 --user --package-db=clear --package-db=global --package-db=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/pkgdb --libdir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/lib --bindir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/bin --datadir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/share --libexecdir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/libexec --sysconfdir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/etc --docdir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/doc/direct-sqlcipher-2.3.27 --htmldir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/doc/direct-sqlcipher-2.3.27 --haddockdir=/Users/fire/.stack/snapshots/aarch64-osx/7c2eb0860757e07bb0396fb26db1225a5c5976980f83c2b5df9e32a2584fa5c1/8.10.7/doc/direct-sqlcipher-2.3.27 --dependency=base=base-4.14.3.0 --dependency=bytestring=bytestring-0.10.12.0 --dependency=text=text-1.2.4.1 -f-commoncrypto -ffulltextsearch -fhaveusleep -fjson1 -fopenssl -f-systemlib -f-tomcrypt -furifilenames --exact-configuration --ghc-option=-fhide-source-paths
    Process exited with code: ExitFailure 1
~/simplex-chat stable 1m 39.2s | 1 ❱
direct-sqlcipher                 > Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7: Missing dependency on a foreign
direct-sqlcipher                 > library:
direct-sqlcipher                 > * Missing (or bad) C library: crypto
direct-sqlcipher                 > This problem can usually be solved by installing the system package that
direct-sqlcipher                 > provides this library (you may need the "-dev" version). If the library is
direct-sqlcipher                 > already installed but in a non-standard location then you can use the flags
direct-sqlcipher                 > --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
direct-sqlcipher                 > library file does exist, it may contain errors that are caught by the C
direct-sqlcipher                 > compiler at the preprocessing stage. In this case you can re-run configure
direct-sqlcipher                 > with the verbosity flag -v3 to see the error messages.
direct-sqlcipher                 >

@epoberezkin
Copy link
Member

  1. use cabal, it won't compile with stack - I'm updating the doc (there is an open PR, but not complete)
  2. you need to add cabal.project.local pointing to the location of libcrypto - see CONTRIBUTING.md in docs folder.

@solus-hq
Copy link
Contributor

solus-hq commented Nov 14, 2022

  1. use cabal, it won't compile with stack - I'm updating the doc (there is an open PR, but not complete)
  2. you need to add cabal.project.local pointing to the location of libcrypto - see CONTRIBUTING.md in docs folder.

Did every step from your latest PR (using cabal) and still sqlcipher is failing to build =(

Failed to build direct-sqlcipher-2.3.27. The failure occurred during the
configure step.
Build log (
/Users/fire/.cabal/logs/ghc-8.10.7/drct-sqlcphr-2.3.27-271ee7ce.log ):
Configuring library for direct-sqlcipher-2.3.27..
cabal-3.6.2.0: Missing dependency on a foreign library:
* Missing (or bad) C library: crypto
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

cabal: Failed to build direct-sqlcipher-2.3.27 (which is required by
exe:simplex-bot-advanced from simplex-chat-4.2.1, exe:simplex-bot from
simplex-chat-4.2.1 and others). See the build log above for details.

~/simplex-chat stable 1m 29s | 1 ❱ vim cabal.project.local

I have these options for OpenSSL, shall I install other package?

~/simplex-chat stable | 1 ❱ brew search openssl
==> Formulae
glib-openssl                                      openssh ✔                                         openfst
openssl@1.1 ✔                                     opensaml                                          opencsg
openssl@3                                         opensc                                            openmsx
openslp                                           open-sp                                           homebrew/portable-ruby/portable-openssl

It seems that your example is mentioning openssl@3, but I have @1.1 installed.

@solus-hq
Copy link
Contributor

Having openssl@3 package installed resolves the problem, finally!

It took 18m 7s to compile from the simplex-chat repo on a Macbook Pro M1 with 16gb of RAM

@shumvgolove shumvgolove added bug Something isn't working terminal Related to terminal app labels Nov 21, 2022
@shumvgolove shumvgolove pinned this issue Nov 21, 2022
@Snake883
Copy link

In the future I hope for Linux AppImage, Flatpak, or similar.

@westhighr
Copy link

I fixed the problem with the command sudo dnf install openssl1.1 on fedora with the package manager dnf.

@tomquas
Copy link

tomquas commented Feb 26, 2023

failed to build on macos-arm64, too.

$ docker build .
...
#7 47.67 [ Info  ] Unpacking: ghc-8.10.7-aarch64-deb10-linux.tar.xz to /root/.ghcup/tmp/ghcup-ab8065eeee4453d0
#7 70.45 [ Info  ] Installing GHC (this may take a while)

#7 71.97
#7 71.97
#7 71.97
#7 71.97
#7 71.97
#7 74.76 [ Error ] [GHCup-00841] Process "make" with arguments ["DESTDIR=/root/.ghcup/tmp/ghcup-cb24028a5d988ddd",
#7 74.76 [ ...   ]                                "install"] failed with exit code 2.
#7 74.76 [ Error ] Also check the logs in /root/.ghcup/logs
------
executor failed running [/bin/sh -c ghcup install ghc 8.10.7]: exit code: 3

the cli would be really handy for some testing...

@JakeTrock
Copy link

JakeTrock commented Feb 28, 2023

For those using linux(maybe x86 mac too) this may be helpful: #1762

@maxwell-kalin
Copy link

Doesnt work on ubuntu or anything based on it

@doomguy
Copy link

doomguy commented Apr 25, 2023

Since I also got an openssl error when trying to run the CLI on Apple Silicon, I tried to compile it with Docker to no avail:

% DOCKER_BUILDKIT=1 docker build --output build/. .
[+] Building 217.4s (8/16)                                                                                                                                                                    
 => [internal] load build definition from Dockerfile                                                                                                                                     0.0s
 => => transferring dockerfile: 841B                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/ubuntu:focal                                                                                                                          5.9s
 => [build  1/11] FROM docker.io/library/ubuntu:focal@sha256:db8bf6f4fb351aa7a26e27ba2686cf35a6a409f65603e59d4c203e58387dc6b3                                                            1.4s
 => => resolve docker.io/library/ubuntu:focal@sha256:db8bf6f4fb351aa7a26e27ba2686cf35a6a409f65603e59d4c203e58387dc6b3                                                                    0.0s
 => => sha256:db8bf6f4fb351aa7a26e27ba2686cf35a6a409f65603e59d4c203e58387dc6b3 1.13kB / 1.13kB                                                                                           0.0s
 => => sha256:144e6a778925a0c11c4cd9fe5fce1172e620f215b0410bb43e7fa41bbcfe4522 424B / 424B                                                                                               0.0s
 => => sha256:758cd4ebb2178eb0cd2ce78dea8ffad569f5bba415c4b33b694e891e7697e854 2.32kB / 2.32kB                                                                                           0.0s
 => => sha256:8659cf1709ef03be2c0b2dc339b19432bff8a0753d2d7d53f47272f098f56ef4 25.97MB / 25.97MB                                                                                         0.8s
 => => extracting sha256:8659cf1709ef03be2c0b2dc339b19432bff8a0753d2d7d53f47272f098f56ef4                                                                                                0.5s
 => [internal] load build context                                                                                                                                                        1.1s
 => => transferring context: 112.54MB                                                                                                                                                    1.1s
 => [build  2/11] RUN apt-get update && apt-get install -y curl git build-essential libgmp3-dev zlib1g-dev libssl-dev                                                                   15.2s
 => [build  3/11] RUN a=$(arch); curl https://downloads.haskell.org/~ghcup/$a-linux-ghcup -o /usr/bin/ghcup &&     chmod +x /usr/bin/ghcup                                               4.6s
 => ERROR [build  4/11] RUN ghcup install ghc 8.10.7                                                                                                                                   190.1s 
------                                                                                                                                                                                        
 > [build  4/11] RUN ghcup install ghc 8.10.7:                                                                                                                                                
#7 0.137 [ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file /root/.ghcup/cache/ghcup-0.0.7.yaml                                  
#7 0.145   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                      
#7 0.145                                  Dload  Upload   Total   Spent    Left  Speed                                                                                                        
100  243k  100  243k    0     0   896k      0 --:--:-- --:--:-- --:--:--  896k                                                                                                                
#7 0.475 [ Info  ] downloading: https://downloads.haskell.org/~ghc/8.10.7/ghc-8.10.7-aarch64-deb10-linux.tar.xz as file /root/.ghcup/tmp/ghcup-ff7dcda0e81a5f9c/ghc-8.10.7-aarch64-deb10-linux.tar.xz
#7 0.483   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#7 0.483                                  Dload  Upload   Total   Spent    Left  Speed
100  299M  100  299M    0     0  1906k      0  0:02:40  0:02:40 --:--:-- 1512k
#7 161.4 [ Info  ] verifying digest of: ghc-8.10.7-aarch64-deb10-linux.tar.xz
#7 162.6 [ Info  ] Unpacking: ghc-8.10.7-aarch64-deb10-linux.tar.xz to /root/.ghcup/tmp/ghcup-f934ddd467fff8db
#7 185.0 [ Info  ] Installing GHC (this may take a while)

#7 186.6 
#7 186.6 
#7 186.6 
#7 186.6 
#7 186.6 
#7 189.7 [ Error ] [GHCup-00841] Process "make" with arguments ["DESTDIR=/root/.ghcup/tmp/ghcup-598f9a8b08ea4182",
#7 189.7 [ ...   ]                                "install"] failed with exit code 2.
#7 189.7 [ Error ] Also check the logs in /root/.ghcup/logs
------
executor failed running [/bin/sh -c ghcup install ghc 8.10.7]: exit code: 3

@WilhelmFreiheitsberg
Copy link

For those using linux(maybe x86 mac too) this may be helpful: #1762

Just did what JakeTrock suggested and it's working fine!

My OS is Ubuntu 22.04

@i18nde
Copy link

i18nde commented Sep 14, 2023

For those using linux(maybe x86 mac too) this may be helpful: #1762

Just did what JakeTrock suggested and it's working fine!

My OS is Ubuntu 22.04

Thank you, worked like a charm. But, it cannot be a long-lasting solution.

@ralyodio
Copy link

ralyodio commented Feb 4, 2024

doesn't work on ubuntu 22.04. oh well. back to signal i guess.

@kseistrup
Copy link

@ralyodio

Please notice that there are two pre-compiled binaries with ubuntu in the name:

  • simplex-chat-ubuntu-20_04-x86-64 ← linked against libcrypto.so.1.1
  • simplex-chat-ubuntu-22_04-x86-64 ← linked against libcrypto.so.3

If the one you installed didn't work, try the other one.

@ralyodio
Copy link

ralyodio commented Feb 4, 2024

where do I download them??

@kseistrup
Copy link

@ralyodio

Frome the “Releases” section:

The latest stable release is v5.5.1:

@ralyodio
Copy link

ralyodio commented Feb 4, 2024

$ sudo dpkg -i simplex-chat-ubuntu-22_04-x86-64  
dpkg-deb: error: 'simplex-chat-ubuntu-22_04-x86-64' is not a Debian format archive
dpkg: error processing archive simplex-chat-ubuntu-22_04-x86-64 (--install):
 dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
 simplex-chat-ubuntu-22_04-x86-64

@kseistrup
Copy link

Those are just uncompressed binaries with a very long name, not Debian packages.

Choose one that ends in .deb.

@kseistrup
Copy link

kseistrup commented Feb 4, 2024

PS: [I am not a Ubuntu user] I can see that the .deb packages are for the desktop version. If that is not what you want, you'll have to install the one you tried before manually, e.g.:

# Assuming that the name in the installed binary is “simplex-chat”,
# otherwise adjust:
$ sudo install -m 0755 -s simplex-chat-ubuntu-22_04-x86-64 /usr/bin/simplex-chat

edit: typo

@ralyodio
Copy link

ralyodio commented Feb 4, 2024

I only see the desktop version in .deb. i want the cli version.

@kseistrup
Copy link

Yes, and therefore I suggested that you install the CLI version manually — i.e., outside of the packaging system.

@ralyodio
Copy link

ralyodio commented Feb 4, 2024

how do i do that?

@kseistrup
Copy link

It seems you earlier downloaded simplex-chat-ubuntu-22_04-x86-64 — the one you attempted to install as a debian package with sudo dpkg -i.

If you cd to the directory with that file and do this:

sudo install -m 0755 -s simplex-chat-ubuntu-22_04-x86-64 /usr/bin/simplex-chat

it will install the executable in /usr/bin and it can be launched from the CLI as simplex-chat.

After you have installed it in /usr/bin you can delete the file with the long filename.


Here's a breakdown of what the command does:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terminal Related to terminal app
Projects
None yet
Development

No branches or pull requests