Code Monkey home page Code Monkey logo

Comments (14)

vysheng avatar vysheng commented on May 22, 2024

I can try to do anything, but I don't have any windows computers. Libexec is used only for backtrace, so it can be removed in cygwin version.

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Let¨s try something, abusing my non-existent habilities:

  • dos2unix -f configure
  • I've get rid of backtrace related code from main.c.
  • This error was given:
$ LC_ALL=C make
gcc -g -O2  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c main.c -o main.o
In file included from main.c:48:0:
interface.h:42:6: error: conflicting types for 'iprintf'
 void iprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
      ^
In file included from /usr/include/stdio.h:29:0,
                 from main.c:24:
/usr/include/stdio.h:253:5: note: previous declaration of 'iprintf' was here
 int _EXFUN(iprintf, (const char *, ...)
     ^
Makefile:30: recipe for target 'main.o' failed
make: *** [main.o] Error 1

Solved by:

$ sed -i 's/iprintf/my_iprintf/g' *.c *.h
  • Now if fails with:
$ LC_ALL=C make
gcc -g -O2  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c net.c -o net.o
net.c: In function 'create_connection':
net.c:272:34: error: 'POLLRDHUP' undeclared (first use in this function)
   s.events = POLLOUT | POLLERR | POLLRDHUP | POLLHUP;
                                  ^
net.c:272:34: note: each undeclared identifier is reported only once for each function it appears in
net.c: In function 'connections_make_poll_array':
net.c:556:43: error: 'POLLRDHUP' undeclared (first use in this function)
       fds[0].events = POLLERR | POLLHUP | POLLRDHUP | POLLIN;
                                           ^
net.c: In function 'connections_poll_result':
net.c:580:47: error: 'POLLRDHUP' undeclared (first use in this function)
     if (fds[i].revents & (POLLHUP | POLLERR | POLLRDHUP)) {
                                               ^
Makefile:30: recipe for target 'net.o' failed
make: *** [net.o] Error 1

from tg.

vysheng avatar vysheng commented on May 22, 2024

Maybe I fixed this. Try again?

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Same error after commit e12d05b
Have the changes been committed? Since my first try just one commit reached the tree (the last one, regarding to a typo in readme).

from tg.

vysheng avatar vysheng commented on May 22, 2024

My bad, did not push them to github. No should be ok.

from tg.

ashtophet avatar ashtophet commented on May 22, 2024
$ LC_ALL=C make
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c main.c -o main.o~~~
main.c:420:2: error: #else without #if
 #else
  ^
main.c:424:2: error: #endif without #if
 #endif
  ^
Makefile:30: recipe for target 'main.o' failed
make: *** [main.o] Error 1

```
$ LC_ALL=C make
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c main.c -o main.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c loop.c -o loop.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c interface.c -o interface.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c net.c -o net.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c mtproto-common.c -o mtproto-common.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c mtproto-client.c -o mtproto-client.o
mtproto-client.c: In function 'rpc_execute':
mtproto-client.c:1715:35: error: 'TCP_QUICKACK' undeclared (first use in this function)
   setsockopt (c->fd, IPPROTO_TCP, TCP_QUICKACK, (int[]){0}, 4);
                                   ^
mtproto-client.c:1715:35: note: each undeclared identifier is reported only once for each function it appears in
mtproto-client.c: In function 'tc_becomes_ready':
mtproto-client.c:1773:35: error: 'TCP_QUICKACK' undeclared (first use in this function)
   setsockopt (c->fd, IPPROTO_TCP, TCP_QUICKACK, (int[]){0}, 4);
                                   ^
Makefile:30: recipe for target 'mtproto-client.o' failed
make: *** [mtproto-client.o] Error 1
```

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Added the following lines at mtproto-client.c

#ifndef TCP_QUICKACK
#define TCP_QUICKACK 0
#endif

and

$ LC_ALL=C make
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c mtproto-client.c -o mtproto-client.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c queries.c -o queries.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c structures.c -o structures.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c binlog.c -o binlog.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c tools.c -o tools.o
gcc -g -O2 -DNO_BACKTRACE  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c lua-tg.c -o lua-tg.o
gcc main.o loop.o interface.o net.o mtproto-common.o mtproto-client.o queries.o structures.o binlog.o tools.o lua-tg.o  -lm -lcrypto -lz -lssl -rdynamic -ggdb -lreadline -lrt -o telegram

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Builds fine, but:

$ ./telegram.exe -k tg.pub
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
[/home/USER/.telegram] created
libconfig not enabled
 *** Connect with 173.240.5.1:443 timeout
 *** Can not create connection to DC. Is network down?

We are behind a proxy here, I have $http_proxy and $https_proxy defined (w3m, wget, etc. work fine).

from tg.

vysheng avatar vysheng commented on May 22, 2024

quickack fixed.

I do not understand problems in main. Something strange. Maybe it merged bad with your backtrace fix?

At this moment client does not support http proxy, because it doesn't use http protocol. It's support is planned (it is not too hard after all) but I am not sure, when I can do it.

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Please, ignore the #else without #if error (maybe I've updated the repository too quick?).

Steps to reproduce it:
1.- dos2unix -f configure.
2.- ./configure --disable-libconfig --disable-liblua
3.- Remove #include <execinfo.h> at main.c
4.- Add the following lines at mtproto-client.c

#ifndef TCP_QUICKACK
#define TCP_QUICKACK 0
#endif

5.- Builds fine.
6.- No net connectivity due to proxy.

from tg.

vysheng avatar vysheng commented on May 22, 2024

#include <execinfo.h> fixed.

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Ok. So the "out-of-the-box" compilation works!
Thank you very much!
Case closed ;)

from tg.

themegabyte avatar themegabyte commented on May 22, 2024

@ashtophet Could you please outline the steps required for the compilation on windows. I am a newbie on windows compiling and don't know exactly where to start. Thanks!

from tg.

ashtophet avatar ashtophet commented on May 22, 2024

Hi,

Unfortunately I didn't writte down the appropriate steps and I don't have
access to a win machine right now. As I recall it:

  1. Install cygwin.
  2. Rerun cygwin setup.exe to install git and the cygwin build tools (
    http://x.cygwin.com/docs/cg/prog-build-prerequisites.html ).
  3. Run ./configure --disable-libconfig and see which library is missing.
    Search for it and install it on cygwin (there shouldn't be many).

Hope that helps in any way.

Cheers

Em terça-feira, 19 de maio de 2015, them3gabyte [email protected]
escreveu:

@ashtophet https://github.com/ashtophet Could you please outline the
steps required for the compilation on windows. I am a newbie on windows
compiling and don't know exactly where to start. Thanks!


Reply to this email directly or view it on GitHub
#45 (comment).

from tg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.