carderne / signal-export

Export your Signal chats to markdown files with attachments
Other
446 stars 47 forks source link

Problem Installing PySqlCipher3 #14

Closed trevdan88 closed 2 years ago

trevdan88 commented 3 years ago

Hi I am trying to install PySqlCipher3 on Windows10, however I am failing to do so.

Please could you help me with some guidance?

carderne commented 3 years ago

Hi @trevdan88, unfortunately I don't have a Windows machine so I don't have any idea... but it doesn't look simple. FYI it's SQLCipher that is difficult to install, pysqlcipher (the Python wrapper) is in theory straight-forward.

Two options: 1) You could try running: pip install pysqlcipher --install-option="--bundled". There's a chance this will do what is needed. source 2) Install WSL (Windows Subsystem for Linux) and try the Linux instructions.

Please let me know if you try either of these and what the outcome is! I'd like to be able to add Windows instructions to the README.

trevdan88 commented 3 years ago

Thanks @carderne

no luck, see the errors below:

C:>pip install pysqlcipher --install-option="--bundled" C:\ProgramData\Anaconda3\lib\site-packages\pip_internal\commands\install.py:230: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option. cmdoptions.check_install_build_global(options) ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_72fa1ae457fe4dc09964fa302a869d7d\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_72fa1ae457fe4dc09964fa302a869d7d\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-_eklworv' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_72fa1ae457fe4dc09964fa302a869d7d\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_72fa1ae457fe4dc09964fa302a869d7d\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/65/1b/f344acad06da78039ad63716e4af0286fea0be1e57da7265dba268079e36/pysqlcipher-2.6.10.tar.gz#sha256=7f31a7846541782b76d17c02e791f115208df2eb62e73de3eb3472cde67c79ac (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_2f329b6fd049450d8f08c07d2c72b8ae\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_2f329b6fd049450d8f08c07d2c72b8ae\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-b6qvsesa' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_2f329b6fd049450d8f08c07d2c72b8ae\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_2f329b6fd049450d8f08c07d2c72b8ae\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/70/4d/6f0d62a1137fd6784a113df8dfcceee73b7d3c20bb472298105b085fad76/pysqlcipher-2.6.9.tar.gz#sha256=5bae49dedb2df08c4a3ca6029672e4560a37ab250c1c98d3272c95f349a93edc (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_68317d0072a8420ca97d8c069125db48\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_68317d0072a8420ca97d8c069125db48\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-fich5nuu' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_68317d0072a8420ca97d8c069125db48\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_68317d0072a8420ca97d8c069125db48\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/07/64/36ad63438160d3253636d44a596cfe908e00987b7cf7f8f8194d0837c91d/pysqlcipher-2.6.8.tar.gz#sha256=15673b79edbc0d04f61d553a5f234bb13ae1f0a626b9e8802f6b5616f468dbd6 (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_b2b32e69fe3b48d39b61f3090a0e9066\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_b2b32e69fe3b48d39b61f3090a0e9066\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-54u26gc5' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_b2b32e69fe3b48d39b61f3090a0e9066\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_b2b32e69fe3b48d39b61f3090a0e9066\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/f7/d7/ed74a30b426058761739101dec651e3730598d5bf493dfcee6e240856aab/pysqlcipher-2.6.7.tar.gz#sha256=5ff5ed828c2651f6b7c8e96c787b41734544cf1dba920ff3cbcd6689b320c868 (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_aa64b1ee95054d8b9845f49c44538ac8\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_aa64b1ee95054d8b9845f49c44538ac8\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-4l0532z5' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_aa64b1ee95054d8b9845f49c44538ac8\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_aa64b1ee95054d8b9845f49c44538ac8\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/f3/09/36f19e6140923e4bc3b1af47178b00aabc5fb51e0ad3cfbb0921801d84a0/pysqlcipher-2.6.6.tar.gz#sha256=913228616ec7e98ac67d99b387fb55f6637e565361a86ebf8aa8efe59a70e83e (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_216cebad68c5422b89c7a3be91809887\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_216cebad68c5422b89c7a3be91809887\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-5e_fmohz' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_216cebad68c5422b89c7a3be91809887\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_216cebad68c5422b89c7a3be91809887\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/96/a4/388b5b070dd379bd530356d799adacb5a5be9a97ce8ea4e1cb248ce92d46/pysqlcipher-2.6.5.tar.gz#sha256=aad4b3be6b5c300579811742ce990beb23a916c79131791bd485c90ce92d3833 (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_d270be57a237499ab94c7db1583987b0\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_d270be57a237499ab94c7db1583987b0\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-ualtfoef' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_d270be57a237499ab94c7db1583987b0\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_d270be57a237499ab94c7db1583987b0\setup.py", line 64 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/08/41/a7c72e4bcf35743bf5c79de7845d3146180379897800d90b5ff5e42eb649/pysqlcipher-2.6.4.tar.gz#sha256=9acd5e583540da6f9bc3d4f9cbbd37610db05d070adcb413c7c99a9725055a46 (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_27f0a9204bb64fa595829efb9fd48e52\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_27f0a9204bb64fa595829efb9fd48e52\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-x903j8t0' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_27f0a9204bb64fa595829efb9fd48e52\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_27f0a9204bb64fa595829efb9fd48e52\setup.py", line 65 print "CFLAGS", os.environ['CFLAGS'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("CFLAGS", os.environ['CFLAGS'])?

WARNING: Discarding https://files.pythonhosted.org/packages/c3/00/738e326e3751c4e3fc59151223fa17e3635532bb6846d8ea6e06bb792e62/pysqlcipher-2.6.3-1.tar.gz#sha256=9e81f6993c2803b7937b6ab2a6c2203bef8de7e4edfe16c2066687475255e399 (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_a80c456d3e284858810dcb871063b824\setup.py'"'"'; file='"'"'C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_a80c456d3e284858810dcb871063b824\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\\AppData\Local\Temp\pip-pip-egg-info-n23q0n4o' cwd: C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_a80c456d3e284858810dcb871063b824\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Temp\pip-install-w8opn8ib\pysqlcipher_a80c456d3e284858810dcb871063b824\setup.py", line 109 print "Downloading amalgation." ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Downloading amalgation.")?

WARNING: Discarding https://files.pythonhosted.org/packages/58/5c/de62fc9a5f61db6d23907caa280b23323c66009b73f439d1cc5b9fcc3983/pysqlcipher-2.6.3.tar.gz#sha256=409b2730ddda40feb500c67850bd61b53794584ea9b636c42800aad0c32c92bd (from https://pypi.org/simple/pysqlcipher/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Could not find a version that satisfies the requirement pysqlcipher ERROR: No matching distribution found for pysqlcipher

C:>

trevdan88 commented 3 years ago

I also tried the steps under - which I "THINK" (hopefully) installed pysqlcipher: https://stackoverflow.com/questions/55446420/issue-in-installing-pysqlcipher3

And when I execute sigexport.py I get the below error:

(base) PS C:\Users\\Documents\projects\signal-export> python sigexport.py output_folder Traceback (most recent call last): File "sigexport.py", line 12, in from pysqlcipher3 import dbapi2 as sqlcipher File "C:\ProgramData\Anaconda3\lib\site-packages\pysqlcipher3\dbapi2.py", line 61, in version_info = tuple([int(x) for x in version.split(".")]) NameError: name 'version' is not defined

trevdan88 commented 3 years ago

What OS do you use? WSL also gave me the same error during PySQLCipher installation.

carderne commented 3 years ago

I use Linux (Ubuntu).

I’ve never used WSL but in theory (I think) you should be able to follow the Ubuntu install instructions on WSL… Sorry it’s not working, thanks for reporting back.

trevdan88 commented 3 years ago

Thanks @carderne my issue with Ubuntu was that signal desktop was not opening. Are you on 20.04 LTS.

trevdan88 commented 3 years ago

I was able to install the same on Ubuntu.

However when I run the Python script sigexport.py it gives me the following errors:

file is encrypted or is not a database

I tried the script with the --manual option as mentioned in the readme as the solution

However I get the error when using --manual:

no such table: conversations

Please advise.

trevdan88 commented 3 years ago

On reading online it says you get the message pysqlcipher3.dbapi2.DatabaseError: file is not a database

occurs when the database version doesn't match the SQLite version on the system, is this correct?

How do we get around this?

I have a documentation on how to get things working till here, I can share this with you so that the documentation can be updated.

carderne commented 3 years ago

Just so I understand, are you talking about Ubuntu or Ubuntu on WSL? I'm assuming the latter. If so please share what you've learned.

About the problem, did you follow the full installation instructions from the README? (I have no idea if anything needs to be done differently under WSL.)

For Linux

Then to get sqlcipher working:

sudo apt install libsqlcipher-dev libssl-dev

Then clone sqlcipher and install it:

git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
mkdir build && cd build
../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
sudo make install
Harkens commented 3 years ago

I installed all the pre-requisites (though I should point out that I never used any of them before so I had to install python, pip, pipx, virtualenv, accidentally update to windows 11 for WSL2, and unbuntu. Did my best to get them all working properly but I'm really not familiar with how these work and something might have slipped in the last step) and it seemed to have been running fine up until installing sqlcipher (I tried it a second time after running the code to clone sqlcipher but to no avail):

Installing signal exporter 6 (redacted)

Other errors I got were "no acceptable C compiler found in $PATH" and ".sigexport.py: No such file or directory" that I tried to fix it using --source and --s but it said that the command was not found (same with sudo make):

Installing signal exporter 5 (redacted)

Also, I'm not quite sure if I'm using the right path for --source? Is it supposed to be this instead?

"C:\Users\\AppData\Roaming\Signal\sql\db.sqlite"

carderne commented 3 years ago

Hi @Harkens, well done for giving it a go! I'm afraid I can't help much with Windows/WSL.

It seems like you couldn't compile sqlcipher because you don't have gcc installed, and there seems to also be an issue with running make. So:

  1. Try installing gcc with sudo apt install build-essential gcc
  2. Then make sure you're in right place: cd ~/sqlcipher/build
  3. Then rerun the last two steps of the instructions one by one (and see if each fails before trying the next!)
    ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
    sudo make install

And if everything went well, you can try to run sigexport. Firstly, did you already do the first steps of the install instructions?

cd ~
git clone https://github.com/carderne/signal-export.git
cd signal-export
pip install -r requirements.txt

If not do them now!

And theeeen you can try running it e.g.

./sigexport test_output

(You may need to add --manual and --source C:\Users\... depending on whether it works.)

Harkens commented 3 years ago

@carderne Thank you so much for the quick response!

gcc seems to have been installed smoothly unless these lines are significant:

Installing signal exporter 7 Installing signal exporter 8

I did encounter another problem with ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto". This time C compiler could not create executables.

Installing signal exporter 9 (redacted)

carderne commented 3 years ago

Sorry, I have no idea, you might need to look into config.log and do some Googling.

Two possible solutions that came on a search that you could try (just a bunch of extra stuff to sudo apt install):

  1. https://askubuntu.com/a/647593
  2. https://stackoverflow.com/a/64476697/6019041
Harkens commented 3 years ago

(Heads up: this is pretty long because I included the output from config.log and ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto")

Double-checked that gcc was installed properly:

which gcc produced /usr/bin/gcc

gcc --version produced:

gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Then used cd ~/sqlcipher/build and cat config.log to check config.log.

Main things I've noticed (full output listed below):

configure:2836: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2836: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:2867: checking whether the C compiler works
configure:2889: gcc -DSQLITE_HAS_CODEC  -lcrypto conftest.c  >&5
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
configure:2893: $? = 1
configure:2931: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "sqlcipher"
| #define PACKAGE_TARNAME "sqlcipher"
| #define PACKAGE_VERSION "3.34.1"
| #define PACKAGE_STRING "sqlcipher 3.34.1"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2936: error: in `/root/sqlcipher/build':
configure:2938: error: C compiler cannot create executables
See `config.log' for more details

I'm guessing I'm missing whatever is needed for -lcrypto. https://stackoverflow.com/questions/62002713/cannot-find-lcrypto https://github.com/znort987/blockparser/issues/38 https://askubuntu.com/questions/396940/found-solutions-to-cannot-find-lcrypto-are-not-working-for-me

So I ran sudo apt-get install libssl-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  libssl-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1582 kB of archives.
After this operation, 8005 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2 [1582 kB]
Fetched 1582 kB in 2s (655 kB/s)
Selecting previously unselected package libssl-dev:amd64.
(Reading database ... 37458 files and directories currently installed.)
Preparing to unpack .../libssl-dev_1.1.1f-1ubuntu2_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1f-1ubuntu2) ...
Setting up libssl-dev:amd64 (1.1.1f-1ubuntu2) ...

And tried using cd ~/sqlcipher/build and ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" again and these are the things I noticed (full output at the bottom):

checking whether the C compiler works... yes
checking for tclsh8.7... no
checking for tclsh8.6... no
checking for tclsh8.5... no
checking for tclsh... no
Warning: can't find tclsh - defaulting to non-amalgamation build.
../configure: line 8492: tclsh: command not found
configure: Version set to 3.34
configure: Release set to 3.34.1
checking whether to support threadsafe operation... yes
checking for library containing pthread_create... -lpthread
checking for library containing pthread_mutexattr_init... none required
checking for crypto library to use... openssl
checking for HMAC_Init_ex in -lcrypto... yes
checking whether to allow connections to be shared across threads... no
checking whether to support shared library linked as release mode or not... no
checking whether to use an in-ram database for temporary tables... yes
checking if executables have the .exe suffix... unknown
checking for Tcl configuration... ../configure: line 9071: tclsh: command not found
../configure: line 9085: tclsh: command not found
configure: WARNING: Can't find Tcl configuration definitions
configure: WARNING: *** Without Tcl the regression tests cannot be executed ***
configure: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***
checking for library containing readline... no
checking for library containing tgetent... no
checking for readline in -lreadline... no
checking readline.h usability... no
checking readline.h presence... no
checking for readline.h... no
checking for /usr/include/readline.h... no
checking for /usr/include/readline/readline.h... no
checking for /usr/local/include/readline.h... no
checking for /usr/local/include/readline/readline.h... no
checking for /usr/local/readline/include/readline.h... no
checking for /usr/local/readline/include/readline/readline.h... no
checking for /usr/contrib/include/readline.h... no
checking for /usr/contrib/include/readline/readline.h... no
checking for /mingw/include/readline.h... no
checking for /mingw/include/readline/readline.h... no
checking for library containing fdatasync... none required
checking zlib.h usability... no
checking zlib.h presence... no
checking for zlib.h... no
checking for library containing deflate... no
checking for library containing dlopen... -ldl
checking whether to support MEMSYS5... no
checking whether to support MEMSYS3... no

Would it safe to proceed with sudo make install?


Full Output cat config.log:

## --------- ##
## Platform. ##
## --------- ##

hostname = <USER>
uname -m = x86_64
uname -r = 5.4.72-microsoft-standard-WSL2
uname -s = Linux
uname -v = #1 SMP Wed Oct 28 23:40:43 UTC 2020
root@<USER>:~/sqlcipher/build#
/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /usr/lib/wsl/lib
PATH: /mnt/c/Windows/system32
PATH: /mnt/c/Windows
PATH: /mnt/c/Windows/System32/Wbem
PATH: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/
PATH: /mnt/c/Windows/System32/OpenSSH/
PATH: /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common
PATH: /mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR
PATH: /mnt/c/Program Files/nodejs/
PATH: /mnt/c/ProgramData/chocolatey/bin
PATH: /mnt/c/WINDOWS/system32
PATH: /mnt/c/WINDOWS
PATH: /mnt/c/WINDOWS/System32/Wbem
PATH: /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/
PATH: /mnt/c/WINDOWS/System32/OpenSSH/
PATH: /mnt/c/Users/<USER>/AppData/Local/Programs/Python/Python39
PATH: /mnt/c/Users/<USER>/AppData/Local/Programs/Python/Python39/Scripts
PATH: /mnt/c/Users/<USER>/AppData/Roaming/Python/Python39/Scripts
PATH: /mnt/c/Users/<USER>/AppData/Local/Microsoft/WindowsApps
PATH: /mnt/c/Users/<USER>/spicetify-cli
PATH: /mnt/c/Users/<USER>/AppData/Roaming/npm
PATH: /mnt/c/Users/<USER>/AppData/Local/Microsoft/WindowsApps
PATH: /mnt/c/Users/<USER>/AppData/Local/Pandoc/
PATH: /mnt/c/Users/<USER>/.local/bin
PATH: /snap/bin

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2387: checking build system type
configure:2401: result: x86_64-pc-linux-gnu
configure:2421: checking host system type
configure:2434: result: x86_64-pc-linux-gnu
configure:2475: checking how to print strings
configure:2502: result: printf
configure:2571: checking for gcc
configure:2587: found /usr/bin/gcc
configure:2598: result: gcc
configure:2827: checking for C compiler version
configure:2836: gcc --version >&5
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2847: $? = 0
configure:2836: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
configure:2847: $? = 0
configure:2836: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2847: $? = 1
configure:2836: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:2847: $? = 1
configure:2867: checking whether the C compiler works
configure:2889: gcc -DSQLITE_HAS_CODEC  -lcrypto conftest.c  >&5
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
configure:2893: $? = 1
configure:2931: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "sqlcipher"
| #define PACKAGE_TARNAME "sqlcipher"
| #define PACKAGE_VERSION "3.34.1"
| #define PACKAGE_STRING "sqlcipher 3.34.1"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2936: error: in `/root/sqlcipher/build':
configure:2938: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-DSQLITE_HAS_CODEC
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-lcrypto
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_TCLLIBDIR_set=
ac_cv_env_TCLLIBDIR_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_prog_ac_ct_CC=gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

ALLOWRELEASE=''
AR=''
AWK=''
BUILD_CC=''
BUILD_CFLAGS=''
BUILD_EXEEXT=''
CC='gcc'
CFLAGS='-DSQLITE_HAS_CODEC'
CPP=''
CPPFLAGS=''
DEFS=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GREP=''
HAVE_TCL=''
HAVE_ZLIB=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LD=''
LDFLAGS='-lcrypto'
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MANIFEST_TOOL=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OPT_FEATURE_FLAGS=''
OTOOL64=''
OTOOL=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='sqlcipher'
PACKAGE_STRING='sqlcipher 3.34.1'
PACKAGE_TARNAME='sqlcipher'
PACKAGE_URL=''
PACKAGE_VERSION='3.34.1'
PATH_SEPARATOR=':'
RANLIB=''
RELEASE=''
SED=''
SHELL='/bin/bash'
SQLITE_OS_UNIX=''
SQLITE_OS_WIN=''
SQLITE_THREADSAFE=''
STRIP=''
TARGET_DEBUG=''
TARGET_EXEEXT=''
TARGET_HAVE_EDITLINE=''
TARGET_HAVE_READLINE=''
TARGET_READLINE_INC=''
TARGET_READLINE_LIBS=''
TCLLIBDIR=''
TCLSH_CMD=''
TCL_BIN_DIR=''
TCL_INCLUDE_SPEC=''
TCL_LIB_FILE=''
TCL_LIB_FLAG=''
TCL_LIB_SPEC=''
TCL_SHLIB_SUFFIX=''
TCL_SRC_DIR=''
TCL_STUB_LIB_FILE=''
TCL_STUB_LIB_FLAG=''
TCL_STUB_LIB_SPEC=''
TCL_VERSION=''
TEMP_STORE=''
USE_AMALGAMATION=''
USE_GCOV=''
VERSION=''
XTHREADCONNECT=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-pc-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "sqlcipher"
#define PACKAGE_TARNAME "sqlcipher"
#define PACKAGE_VERSION "3.34.1"
#define PACKAGE_STRING "sqlcipher 3.34.1"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77

Full Output ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto":

root@<USER>:~/sqlcipher/build# ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for intptr_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uintptr_t... yes
checking for sys/types.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for fdatasync... yes
checking for gmtime_r... yes
checking for isnan... yes
checking for localtime_r... yes
checking for localtime_s... no
checking for malloc_usable_size... yes
checking for strchrnul... yes
checking for usleep... yes
checking for utime... yes
checking for pread... yes
checking for pread64... yes
checking for pwrite... yes
checking for pwrite64... yes
checking for tclsh8.7... no
checking for tclsh8.6... no
checking for tclsh8.5... no
checking for tclsh... no
Warning: can't find tclsh - defaulting to non-amalgamation build.
../configure: line 8492: tclsh: command not found
configure: Version set to 3.34
configure: Release set to 3.34.1
checking whether to support threadsafe operation... yes
checking for library containing pthread_create... -lpthread
checking for library containing pthread_mutexattr_init... none required
checking for crypto library to use... openssl
checking for HMAC_Init_ex in -lcrypto... yes
checking whether to allow connections to be shared across threads... no
checking whether to support shared library linked as release mode or not... no
checking whether to use an in-ram database for temporary tables... yes
checking if executables have the .exe suffix... unknown
checking for Tcl configuration... ../configure: line 9071: tclsh: command not found
../configure: line 9085: tclsh: command not found
configure: WARNING: Can't find Tcl configuration definitions
configure: WARNING: *** Without Tcl the regression tests cannot be executed ***
configure: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***
checking for library containing readline... no
checking for library containing tgetent... no
checking for readline in -lreadline... no
checking readline.h usability... no
checking readline.h presence... no
checking for readline.h... no
checking for /usr/include/readline.h... no
checking for /usr/include/readline/readline.h... no
checking for /usr/local/include/readline.h... no
checking for /usr/local/include/readline/readline.h... no
checking for /usr/local/readline/include/readline.h... no
checking for /usr/local/readline/include/readline/readline.h... no
checking for /usr/contrib/include/readline.h... no
checking for /usr/contrib/include/readline/readline.h... no
checking for /mingw/include/readline.h... no
checking for /mingw/include/readline/readline.h... no
checking for library containing fdatasync... none required
checking zlib.h usability... no
checking zlib.h presence... no
checking for zlib.h... no
checking for library containing deflate... no
checking for library containing dlopen... -ldl
checking whether to support MEMSYS5... no
checking whether to support MEMSYS3... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sqlcipher.pc
config.status: creating config.h
config.status: executing libtool commands
carderne commented 3 years ago

Would it safe to proceed with sudo make install?

:shrug: I guess so, give it a shot!

Harkens commented 3 years ago

Ran sudo make install and:

tclsh /root/sqlcipher/build/../tool/mkshellc.tcl >shell.c
/bin/sh: 1: tclsh: not found
make: *** [Makefile:1138: shell.c] Error 127

Seemed like tcl needed to be installed https://stackoverflow.com/questions/43317238/the-program-tclsh-is-currently-not-installed https://www.devmanuals.net/install/ubuntu/ubuntu-12-04-lts-precise-pangolin/install-tcl.html

Checked proper installation of tcl with which tclsh8.4 and still nothing, turns out I was asking for the wrong version and which tclsh8.6 gave me /usr/bin/tclsh8.6.

Ran ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" again and there are some changes but it Can't find Tcl configuration definitions

checking for tclsh8.7... no
checking for tclsh8.6... tclsh8.6
configure: Version set to 3.34
configure: Release set to 3.34.1
checking whether to support threadsafe operation... yes
checking for library containing pthread_create... -lpthread
checking for library containing pthread_mutexattr_init... none required
checking for crypto library to use... openssl
checking for HMAC_Init_ex in -lcrypto... yes
checking whether to allow connections to be shared across threads... no
checking whether to support shared library linked as release mode or not... no
checking whether to use an in-ram database for temporary tables... yes
checking if executables have the .exe suffix... unknown
checking for Tcl configuration... configure: WARNING: Can't find Tcl configuration definitions
configure: WARNING: *** Without Tcl the regression tests cannot be executed ***
configure: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***
checking for library containing readline... no
checking for library containing tgetent... no
checking for readline in -lreadline... no
checking readline.h usability... no
checking readline.h presence... no
checking for readline.h... no
checking for /usr/include/readline.h... no
checking for /usr/include/readline/readline.h... no
checking for /usr/local/include/readline.h... no
checking for /usr/local/include/readline/readline.h... no
checking for /usr/local/readline/include/readline.h... no
checking for /usr/local/readline/include/readline/readline.h... no
checking for /usr/contrib/include/readline.h... no
checking for /usr/contrib/include/readline/readline.h... no
checking for /mingw/include/readline.h... no
checking for /mingw/include/readline/readline.h... no
checking for library containing fdatasync... none required
checking zlib.h usability... no
checking zlib.h presence... no
checking for zlib.h... no
checking for library containing deflate... no
checking for library containing dlopen... -ldl
checking whether to support MEMSYS5... no
checking whether to support MEMSYS3... no

Googling it suggested to run this command: sudo apt-get install tcl-dev tk-dev mesa-common-dev libjpeg-dev libtogl-dev https://www.linuxquestions.org/questions/linux-software-2/configuration-error-can't-find-tcl-configuration-definition-4175434069/

Ran ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" again and no errors.

checking for Tcl configuration... found /usr/lib/tclConfig.sh
checking for existence of /usr/lib/tclConfig.sh... loading
checking for library containing readline... no

Ran sudo make install and found this at the end (the rest was just completely incomprehensible to me):

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:678: sqlcipher] Error 1

Thought it might be worth a shot to try sudo apt install libsqlcipher-dev libssl-dev this time.

The following additional packages will be installed:
  libsqlcipher0 libssl1.1
Suggested packages:
  sqlite3-doc libssl-doc
The following NEW packages will be installed:
  libsqlcipher-dev libsqlcipher0
The following packages will be upgraded:
  libssl-dev libssl1.1
2 upgraded, 2 newly installed, 0 to remove and 242 not upgraded.

Tried sudo make install again and still the same error. Found these sites but I'm not meddling with that kind of code so I am once again quite lost about how to apply this. https://stackoverflow.com/questions/7965437/undefined-reference-to-main-collect2-ld-returned-1-exit-status/33723769 https://stackoverflow.com/questions/15905119/c-linking-error-undefined-reference-to-main https://www.includehelp.com/c-programs/id-returned-1-exit-status-undefined-reference-to-main-error-in-c.aspx


Full output sudo make install (attempt 3):

./libtool --mode=link gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/root/sqlcipher/build/../src -I/root/sqlcipher/build/../ext/rtree -I/root/sqlcipher/build/../ext/icu -I/root/sqlcipher/build/../ext/fts3 -I/root/sqlcipher/build/../ext/async -I/root/sqlcipher/build/../ext/session -I/root/sqlcipher/build/../ext/userauth -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -I/usr/include/tcl8.6 -DSQLITE_THREADSAFE=1   -DSQLITE_HAVE_ZLIB=1  -lcrypto  -DHAVE_READLINE=0  -DHAVE_EDITLINE=0 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_DESERIALIZE -o sqlcipher \
        shell.c sqlite3.c \
         -ldl -lz -lcrypto -lpthread   -rpath "/usr/local/lib"
libtool: link: gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/root/sqlcipher/build/../src -I/root/sqlcipher/build/../ext/rtree -I/root/sqlcipher/build/../ext/icu -I/root/sqlcipher/build/../ext/fts3 -I/root/sqlcipher/build/../ext/async -I/root/sqlcipher/build/../ext/session -I/root/sqlcipher/build/../ext/userauth -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -I/usr/include/tcl8.6 -DSQLITE_THREADSAFE=1 -DSQLITE_HAVE_ZLIB=1 -DHAVE_READLINE=0 -DHAVE_EDITLINE=0 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_DESERIALIZE -o sqlcipher shell.c sqlite3.c  -ldl -lz -lcrypto -lpthread -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:678: sqlcipher] Error 1
PiWakeTV commented 2 years ago

@Harkens, try: pip3 install pysqlcipher3.

Harkens commented 2 years ago

@PiWakeTV Thanks for the suggestion, however there still seem to be problems with running "make". Double-checked to see if I was missing anything by running everything else that was suggested on this thread but still nothing to solve the error :(

Ran pip3 install pysqlcipher3

Command 'pip3' not found, but can be installed with:

apt install python3-pip

Ran apt install python3-pip then pip3 install pysqlcipher3

python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 237 not upgraded.
Successfully built pysqlcipher3
Installing collected packages: pysqlcipher3
Successfully installed pysqlcipher3-1.0.4

Ran sudo make install and the output gave the same error.

root@<USER>:~/sqlcipher/build# sudo make install
./libtool --mode=link gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/root/sqlcipher/build/../src -I/root/sqlcipher/build/../ext/rtree -I/root/sqlcipher/build/../ext/icu -I/root/sqlcipher/build/../ext/fts3 -I/root/sqlcipher/build/../ext/async -I/root/sqlcipher/build/../ext/session -I/root/sqlcipher/build/../ext/userauth -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -I/usr/include/tcl8.6 -DSQLITE_THREADSAFE=1   -DSQLITE_HAVE_ZLIB=1  -lcrypto  -DHAVE_READLINE=0  -DHAVE_EDITLINE=0 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_DESERIALIZE -o sqlcipher \
        shell.c sqlite3.c \
         -ldl -lz -lcrypto -lpthread   -rpath "/usr/local/lib"
libtool: link: gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_OS_UNIX=1 -I. -I/root/sqlcipher/build/../src -I/root/sqlcipher/build/../ext/rtree -I/root/sqlcipher/build/../ext/icu -I/root/sqlcipher/build/../ext/fts3 -I/root/sqlcipher/build/../ext/async -I/root/sqlcipher/build/../ext/session -I/root/sqlcipher/build/../ext/userauth -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite -DNDEBUG -I/usr/include/tcl8.6 -DSQLITE_THREADSAFE=1 -DSQLITE_HAVE_ZLIB=1 -DHAVE_READLINE=0 -DHAVE_EDITLINE=0 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_DESERIALIZE -o sqlcipher shell.c sqlite3.c  -ldl -lz -lcrypto -lpthread -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:678: sqlcipher] Error 1

Tried running sudo apt install libsqlcipher-dev libssl-dev

root@<USER>:~/sqlcipher/build# sudo apt install libsqlcipher-dev libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsqlcipher-dev is already the newest version (3.4.1-1build2).
libssl-dev is already the newest version (1.1.1f-1ubuntu2.4).
0 upgraded, 0 newly installed, 0 to remove and 237 not upgraded.

and the following to see if it would help

git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
mkdir build && cd build
../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
sudo make install

Output: (I think that cloning sqlcipher failed because I already cloned it before, since I get fatal errors about it already existing and not being an empty directory)

root@<USER>:~/sqlcipher/build# git clone https://github.com/sqlcipher/sqlcipher.git
 sqlcipher
mkdir build && cd build
../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
sudo make install
Cloning into 'sqlcipher'...
fatal: the remote end hung up unexpectedly
root@<USER>:~/sqlcipher/build# cd sqlcipher
-bash: cd: sqlcipher: No such file or directory
root@<USER>:~/sqlcipher/build# mkdir build && cd build
root@<USER>:~/sqlcipher/build/build# ../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
-bash: ../configure: No such file or directory
root@<USER>:~/sqlcipher/build/build# sudo make install
make: *** No rule to make target 'install'.  Stop.

Ran

cd ~
git clone https://github.com/carderne/signal-export.git
cd signal-export
pip install -r requirements.txt

Output:

root@<USER>:~/sqlcipher/build/build# cd ~
t clone root@<USER>:~# git clone https://github.com/carderne/signal-export.git
d signal-export
Cloning into 'signal-export'...
pip install -r requirements.txt
remote: Enumerating objects: 237, done.
remote: Counting objects: 100% (136/136), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 237 (delta 75), reused 130 (delta 72), pack-reused 101
Receiving objects: 100% (237/237), 62.11 KiB | 691.00 KiB/s, done.
Resolving deltas: 100% (137/137), done.
root@<USER>:~# cd signal-export
root@<USER>:~/signal-export# pip install -r requirements.txt
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
     |████████████████████████████████| 115 kB 1.6 MB/s
Requirement already satisfied: Click>=7.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (7.0)
Collecting Markdown>=3.0
  Downloading Markdown-3.3.4-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 1.8 MB/s
Requirement already satisfied: pysqlcipher3>=1.0.3 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 4)) (1.0.4)
Collecting soupsieve>1.2; python_version >= "3.0"
  Downloading soupsieve-2.2.1-py3-none-any.whl (33 kB)
Installing collected packages: soupsieve, beautifulsoup4, Markdown
Successfully installed Markdown-3.3.4 beautifulsoup4-4.9.3 soupsieve-2.2.1

Then I was automatically brought to signal-export so I tried running it

root@<USER>:~/signal-export# ./sigexport test_output
-bash: ./sigexport: No such file or directory

Then tried ./sigexport.py outputdir in case it would work

root@<USER>:~/signal-export# ./sigexport.py outputdir
Error: /root/.config/Signal/config.json not found in directory /root/.config/Signal
PiWakeTV commented 2 years ago

@Harkens When you install pysqlcipher3 via pip(3) it shouldn't be necessary to make/compile it from source code anymore. When you don't have pip3, try with pip instead or install Python 3 before.

Harkens commented 2 years ago

@PiWakeTV Sorry, can you clarify what you mean? Are you saying that I don't need to run sudo make install or the following?

git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
mkdir build && cd build
../configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
sudo make install

I still can't run signal exporter and I have no idea why.

root@<USER>:~/signal-export# ./sigexport.py outputdir
Error: /root/.config/Signal/config.json not found in directory /root/.config/Signal

I do have config.json in C:\Users\<USER>\AppData\Roaming\Signal so I am so lost about what I could be doing wrong.

vinnytroia commented 2 years ago

Anyone experiencing this issue on Mac OS Monteray? I am doing this on the new M1/ARM macbook.

brew install openssl sqlcipher >> works fine

if i run it again, I am told: sqlcipher 4.5.0 is already installed and up-to-date.

but when i try to run sigexport i get:

File "/Users/sysop/miniconda3/lib/python3.8/site-packages/sigexport/main.py", line 14, in from pysqlcipher3 import dbapi2 as sqlcipher ModuleNotFoundError: No module named 'pysqlcipher3'

COuld this be the fact that i am tyring to do this in a Condo environment? That usually seems to help, not hurt.

Tahanks

carderne commented 2 years ago

@vinnytroia you could try manually cloning this repo, install with pip install -e signal-export/ and/or manually pip/conda install pysqlcipher3. And just see if you can it to import pysqlcipher3 at all, eg run in the terminal:

python -c "import pysqlcipher3"

But yes it seems like sqlcipher and/or pysqlcipher3 are getting more and more difficult to play with...

schulz-m commented 2 years ago

@vinnytroia I have the same issue without Condo environment - and can't install pysqlcipher with pip - @carderne would it be possible to install a specific version? The requirements.txt on the repo looks empty

carderne commented 2 years ago

The requirements are in setup.cfg.

schulz-m commented 2 years ago

I was hoping the issue could be easily fixed by installing the minimum version (pip3 install -I pysqlcipher3==1.0.3) but installing verbosely, I get the following error: src/python3/connection.h:33:10: fatal error: 'sqlcipher/sqlite3.h' file not found

Issues talk about installing libsqlcipher-dev, but not sure what would be the macOS equivalent? (Issue #1, Issue #2)

There is also an issue on sqlcipher3 about the installation not working on macOS (link)

PS: pysqlcipher3 is not actively maintained anymore

carderne commented 2 years ago

Would recommend you to try the new Docker instructions, which should bypass all the sqlcipher3 difficulties. Check the README.

carmanber commented 1 year ago

I know this is an old thread but in case somebody tries to install SQLCipher plus python package on a M1 mac, this saved me (need to recompile and rebuild totally).

brew install sqlcipher
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"

git clone https://github.com/sqlcipher/sqlcipher
cd sqlcipher/
./configure
make sqlite3.c

cd ..
git clone https://github.com/coleifer/sqlcipher3
cp sqlcipher/sqlite3.[ch] sqlcipher3/
cd sqlcipher3
python setup.py build_static build