tg icon indicating copy to clipboard operation
tg copied to clipboard

Make failed on Ubuntu 20.04

Open boospy opened this issue 4 years ago • 16 comments

Hello all,

configure works normal, but on make i get this errors on Ubuntu 20.04

gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/queries.d -MQ objs/queries.o -o objs/queries.o tgl/queries.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/rsa_pem_openssl.d -MQ objs/crypto/rsa_pem_openssl.o -o objs/crypto/rsa_pem_openssl.o tgl/crypto/rsa_pem_openssl.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-free-ds.d -MQ objs/auto-free-ds.o -o objs/auto/auto-free-ds.o auto/auto-free-ds.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-store-ds.d -MQ objs/auto-store-ds.o -o objs/auto/auto-store-ds.o auto/auto-store-ds.c
bin/generate -g print-ds auto/scheme.tlo > auto/auto-print-ds.c || ( rm auto/auto-print-ds.c && false )
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-print-ds.d -MQ objs/auto-print-ds.o -o objs/auto/auto-print-ds.o auto/auto-print-ds.c
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_new’:
tgl/crypto/rsa_pem_openssl.c:41:6: error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘struct rsa_st’}
   41 |   ret->e = unwrap_bn (TGLC_bn_new ());
      |      ^~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_n’:
tgl/crypto/rsa_pem_openssl.c:50:3: error: control reaches end of non-void function [-Werror=return-type]
   50 |   }                                                                            \
      |   ^
tgl/crypto/rsa_pem_openssl.c:52:1: note: in expansion of macro ‘RSA_GETTER’
   52 | RSA_GETTER(n);
      | ^~~~~~~~~~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_e’:
tgl/crypto/rsa_pem_openssl.c:50:3: error: control reaches end of non-void function [-Werror=return-type]
   50 |   }                                                                            \
      |   ^
tgl/crypto/rsa_pem_openssl.c:53:1: note: in expansion of macro ‘RSA_GETTER’
   53 | RSA_GETTER(e);
      | ^~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.tgl:20: objs/crypto/rsa_pem_openssl.o] Fehler 1
make: *** Auf noch nicht beendete Prozesse wird gewartet …
tgl/queries.c: In function ‘_tgl_do_send_photo’:
tgl/queries.c:2091:10: error: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int,  struct tgl_message *)’ to ‘void (*)(struct tgl_state *, void *, int)’ [-Werror=cast-function-type]
 2091 |         ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
      |          ^
tgl/queries.c:2108:10: error: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int,  struct tgl_message *)’ to ‘void (*)(struct tgl_state *, void *, int)’ [-Werror=cast-function-type]
 2108 |         ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
      |          ^
tgl/queries.c:2141:10: error: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int,  struct tgl_message *)’ to ‘void (*)(struct tgl_state *, void *, int)’ [-Werror=cast-function-type]
 2141 |         ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
      |          ^
cc1: all warnings being treated as errors
make: *** [Makefile.tgl:20: objs/queries.o] Fehler 1

Can you help me with? I would like to buld a DEB-Package and Upload it to us public Apt-Repository: https://apt.iteas.at

boospy avatar Jan 14 '21 02:01 boospy

I can relate I got the same issue, I installed it using the following commands:

git clone --recursive https://github.com/vysheng/tg.git && cd tg
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make 
./configure
make

I am not on Ubuntu though, I am on Debian

snowc0de avatar Feb 27 '21 09:02 snowc0de

Debian, Buster: sudo apt install libssl1.0-dev

Paulchen232 avatar Feb 27 '21 14:02 Paulchen232

On Ubuntu there is the package libssl-dev. But this did not work here.

boospy avatar Feb 28 '21 00:02 boospy

On Ubuntu 20.04 try this: sudo apt install libssl1.1=1.1.1f-1ubuntu2

Paulchen232 avatar Feb 28 '21 09:02 Paulchen232

Thank you for that information. I also installed the dev package in the same version. But if i start make, i get an error again.

gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/queries.d -MQ objs/queries.o -o objs/queries.o tgl/queries.c
tgl/queries.c: In function ‘_tgl_do_send_photo’:
tgl/queries.c:2091:10: error: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int,  struct tgl_message *)’ to ‘void (*)(struct tgl_state *, void *, int)’ [-Werror=cast-function-type]
 2091 |         ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
      |          ^
tgl/queries.c:2108:10: error: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int,  struct tgl_message *)’ to ‘void (*)(struct tgl_state *, void *, int)’ [-Werror=cast-function-type]
 2108 |         ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
      |          ^
tgl/queries.c:2141:10: error: cast between incompatible function types from ‘void (*)(struct tgl_state *, void *, int,  struct tgl_message *)’ to ‘void (*)(struct tgl_state *, void *, int)’ [-Werror=cast-function-type]
 2141 |         ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
      |          ^
cc1: all warnings being treated as errors
make: *** [Makefile.tgl:20: objs/queries.o] Fehler 1

Best Regards

boospy avatar Feb 28 '21 23:02 boospy

Have you install libssl-dev after that, libssl1.1 depends on that.

Paulchen232 avatar Mar 01 '21 00:03 Paulchen232

Perhaps this helps also #1633.

Paulchen232 avatar Mar 01 '21 00:03 Paulchen232

I got this, on my ubuntu machine.. so you might have to change your apt install line to reflect it

Package libpython-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libpython2-dev

lvennard avatar Apr 04 '21 23:04 lvennard

I've tested here an build process on debian 10. It is also not buildable.

tgl/crypto/rsa_pem_openssl.c: In function 'TGLC_rsa_new':
tgl/crypto/rsa_pem_openssl.c:41:6: error: dereferencing pointer to incomplete type 'RSA' {aka 'struct rsa_st'}
   ret->e = unwrap_bn (TGLC_bn_new ());
      ^~
tgl/crypto/rsa_pem_openssl.c: In function 'TGLC_rsa_n':
tgl/crypto/rsa_pem_openssl.c:52:1: error: control reaches end of non-void function [-Werror=return-type]
 RSA_GETTER(n);
 ^~~~~~~~~~
tgl/crypto/rsa_pem_openssl.c: In function 'TGLC_rsa_e':
tgl/crypto/rsa_pem_openssl.c:53:1: error: control reaches end of non-void function [-Werror=return-type]
 RSA_GETTER(e);
 ^~~~~~~~~~

boospy avatar Apr 05 '21 06:04 boospy

@boospy Have you install libssl1.0-dev? It works on Raspberry Pi OS Lite.

Paulchen232 avatar Apr 05 '21 17:04 Paulchen232

@boospy Have you install libssl1.0-dev? It works on Raspberry Pi OS Lite.

This version is on actual debian not available anymore.

root@debiandev:~/tg# dpkg -l libssl-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version          Architecture Description
+++-================-================-============-================================================
ii  libssl-dev:amd64 1.1.1d-0+deb10u6 amd64        Secure Sockets Layer toolkit - development files
root@debiandev:~/tg# apt-cache madison libssl-dev
libssl-dev | 1.1.1d-0+deb10u6 | http://ftp.debian.org/debian-buster-security buster/updates/main amd64 Packages
libssl-dev | 1.1.1d-0+deb10u5 | http://ftp.debian.org/debian-buster/debian buster/main amd64 Packages


boospy avatar Apr 05 '21 19:04 boospy

libssl1.0-dev ≠ libssl-dev Try sudo apt install libssl1.0-dev

Raspberry Pi OS Lite is now a Debian 10 distribution.

Paulchen232 avatar Apr 06 '21 00:04 Paulchen232

You are right PI is now Debian10, and this packages is there available, i've tested it for a minute. But on normal x86_64 Debian10, this package is not available anymore.

boospy avatar Apr 06 '21 19:04 boospy

i have solve it by running env CFLAGS="-Wno-cast-function-type" ./configure --disable-openssl

Linch1 avatar May 14 '21 21:05 Linch1

Got the same error, solved running: sudo apt-get install -y libgcrypt-dev

Draecal avatar Mar 15 '22 19:03 Draecal