vysheng / tg

telegram-cli
GNU General Public License v2.0
6.49k stars 1.54k forks source link

Does not compile in Fedora 26 #1382

Open leleobhz opened 7 years ago

leleobhz commented 7 years ago

Hello!

Compilation in Fedora 26 results in this result:

gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include   -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
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);
 ^~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.tgl:20: objs/crypto/rsa_pem_openssl.o] Error 1

A little search brings me to this: https://github.com/openssl/openssl/issues/1491 (And refered issues also cites "Make GCC 7.1 happy" :P

Can this issue be fixed?

Thanks!

lsatenstein commented 7 years ago

Yes. The problem is the new increased diagnostics offered. By gcc. The compiler does not want to take decisions about the ambiguous syntax. And it is checking that a function acts as prototyped. Fix the posted errors and that module will compile correctly.

ther0y commented 7 years ago

i dont know its consequences but in ubuntu i solved this by "./configure --disable-openssl" and running "make" again

coolguy45 commented 7 years ago

You may be able to use the procedure here: http://www.jt360.net/home/tech-articles/install-and-configure-the-telegram-client-on-raspberry-pi however you will need to use yum instead of apt-get and also the correct fedora package names. But the other tweaks should work.

hbh7 commented 6 years ago

I found this to work as well. https://github.com/freifunk-gluon/gluon/issues/973#issuecomment-265911151