gintonik
Posts: 35
Joined: Fri Apr 22, 2016 4:09 pm

Compile Telegram to Raspian Buster

Sun Jul 21, 2019 9:49 am

Hi,

i need to install the TELEGRAM-Messanger to a RPI-B with Raspian Buster. System ist fully updated ans runs good.

I use the Instruction for installing:

Code: Select all

sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make
git clone --recursive https://github.com/vysheng/tg.git && cd tg
./configure
make
Everything is fine, but if i use MAKE it starts compiling but then it stop with an Error-Message:

Code: Select all

[email protected]:~/tg $ sudo make

cat tgl/scheme.tl tgl/encrypted_scheme.tl tgl/binlog.tl tgl/append.tl tgl/mtproto.tl > auto/scheme.tl

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/tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tgl/tl-parser/tl-parser.c

tgl/tl-parser/tl-parser.c: In function ‘tl_parse_args134’:

tgl/tl-parser/tl-parser.c:1907:26: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]

sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());

^

tgl/tl-parser/tl-parser.c:1907:9: note: ‘sprintf’ output between 2 and 21 bytes into a destination of size 20

sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

make: *** [Makefile.tl-parser:4: objs/tl-parser.o] Fehler 1

[email protected]:~/tg $ sudo make

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/tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tgl/tl-parser/tl-parser.c

tgl/tl-parser/tl-parser.c: In function ‘tl_parse_args134’:

tgl/tl-parser/tl-parser.c:1907:26: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]

sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());

^

tgl/tl-parser/tl-parser.c:1907:9: note: ‘sprintf’ output between 2 and 21 bytes into a destination of size 20

sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

make: *** [Makefile.tl-parser:4: objs/tl-parser.o] Fehler 1

[email protected]:~/tg $
I don´t know what i can do for fix this Issue...

epoch1970
Posts: 3572
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Compile Telegram to Raspian Buster

Sun Jul 21, 2019 10:01 am

The issue tracker is lively on this project. Suggest you use it.
https://github.com/vysheng/tg/issues/1610
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

gintonik
Posts: 35
Joined: Fri Apr 22, 2016 4:09 pm

Re: Compile Telegram to Raspian Buster

Sun Jul 21, 2019 10:08 am

Hi epoch1970,

thank you for your Post.

Code: Select all

A User Name Paulchen written this:

cc1: all warnings being treated as errors

That comes from -Werror in Makefile.
So remove that.
but i don´t know where i can remove it. Can you help me again?

gintonik
Posts: 35
Joined: Fri Apr 22, 2016 4:09 pm

Re: Compile Telegram to Raspian Buster

Sun Jul 21, 2019 10:12 am

Hi,

i think i found the file who needed edited!!!

In the /tg-Folder is a File named makefile, i edited this on an found a parameter "-werror", i deleted that. Now it should working. Thank you very much!!!!

gintonik
Posts: 35
Joined: Fri Apr 22, 2016 4:09 pm

Re: Compile Telegram to Raspian Buster

Sun Jul 21, 2019 4:09 pm

There was an Issue again!

I found an other Github-Package, where it works fine.

The correct Instruction is:

Code: Select all


sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make
git clone --recursive https://github.com/kenorb-contrib/tgl.git && cd tgl
./configure
make

dkoud
Posts: 3
Joined: Wed Aug 07, 2019 10:27 am
Location: Cygnet

Re: Compile Telegram to Raspian Buster

Wed Aug 07, 2019 11:53 am

I had the same problems when I used the instructions that worked on Raspbian Sretch but gave me all the same errors. I removed -Werror in the file makefile but make still failed
I followed gintonik's instructions outlined in his post Mon Jul 22, 2019 2:09 am
./configure and make worked without any errors. The installation created a folder named tgl
However, I have been unable to locate the executable file and or command to start telegram in cli mode.
I would be grateful if gintonik could let me know how he managed to start the telegram cli from the installation

Code: Select all

[git clone --recursive https://github.com/kenorb-contrib/tgl.git && cd tgl
./configure/code]

Return to “General programming discussion”