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

Cannot compile in Fedora 28 #1537

Open
izauddin opened this issue Jun 21, 2018 · 12 comments
Open

Cannot compile in Fedora 28 #1537

izauddin opened this issue Jun 21, 2018 · 12 comments

Comments

@izauddin
Copy link

Hi,

I cannot build this on Fedora 28, got the following error when running make

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/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]
((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]
((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]
((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] Error 1

Have follow the instruction at http://www.jt360.net/home/tech-articles/install-and-configure-the-telegram-client-on-raspberry-pi but still giving the above problem.

Or any one have rpm package for Fedora 28 ?

@FredrikAugust
Copy link

Facing same issue on Arch Linux - #1542.

@robimac04
Copy link

robimac04 commented Jul 11, 2018

Same issue here also with Fedora 28...

@FredrikAugust
Copy link

PS: @izauddin, wrap your output in ``` (three consecutive backticks before and after your code) to make it a bit easier to read.

@awkure
Copy link

awkure commented Jul 27, 2018

Ok, faced the same problem with the following error log

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/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]
         ((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]
         ((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]
         ((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] Error 1
$ uname -r 
4.17.7-200.fc28.x86_64

For a dangerous workaraound you have to add -Wno-error=cast-function-type to COMPILE_FLAGS inside your Makefile so it'll look something like this

COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -Wno-error=cast-function-type

And also don't forget to downgrade openssl to openssl10

sudo dnf install compat-openssl10-devel --allowerasing -y 

@Hellseher
Copy link

Facing the same

uname -a; lsb_release -a
Linux base-171027 4.17.3-200.fc28.x86_64 #1 SMP Tue Jun 26 14:17:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 28 (Twenty Eight)
Release:        28
Codename:       TwentyEight

@wotmshuaisi
Copy link

wotmshuaisi commented Sep 7, 2018

fix it this way:

The correct way to set CFLAGS in configure is:

./configure --prefix=/usr CFLAGS="$CFLAGS -w"

which on 64bit gives CFLAGS of:

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -w"

from archlinux.org

@haghighi
Copy link

haghighi commented Oct 2, 2018

On Fedora 28:

$ ./configure --disable-openssl --prefix=/usr CFLAGS="$CFLAGS -w"
$ make

@sitano
Copy link

sitano commented Nov 7, 2018

GCC 8.1.1 does not like incompatible function type casts and reports many Werror=cast-function-type errors. Use env CFLAGS="-Wno-cast-function-type" ./configure

@kenorb
Copy link

kenorb commented Feb 2, 2019

I've fixed the errors in my forks at https://github.com/kenorb-contrib/tg & https://github.com/kenorb-contrib/tgl

@sukhrob322
Copy link

On Fedora 28:

$ ./configure --disable-openssl --prefix=/usr CFLAGS="$CFLAGS -w"
$ make

This solved my issue. Before running this command, also installed libssl1.0-dev

@Bost
Copy link

Bost commented May 13, 2019

On Fedora 28:

$ ./configure --disable-openssl --prefix=/usr CFLAGS="$CFLAGS -w"
$ make

This solved my issue. Before running this command, also installed libssl1.0-dev

I had to install libgcrypt20-dev and libssl-dev

@tces1
Copy link

tces1 commented May 28, 2021

On Fedora 28:

$ ./configure --disable-openssl --prefix=/usr CFLAGS="$CFLAGS -w"
$ make

fixed issue in Centos8

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

No branches or pull requests