vysheng / tg

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

`make` fails on macOS `error: unused function 'get_peer'` #1683

Open Flipp3rrr opened 4 years ago

Flipp3rrr commented 4 years ago

To get ./configure to work I first had to run export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib", export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include" and export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" before ./configure would stop giving missing dependency errors. After this I was ready to run make.

Now I ran make, I got an error and couldn't figure out the problem. Any help would be appreciated.

lua-tg.c:664:27: error: unused function 'get_peer' [-Werror,-Wunused-function]
static inline tgl_peer_t *get_peer (const char *s) {
                          ^
1 error generated.
make: *** [objs/lua-tg.o] Error 1

Full log:

✘ flipp3rrr  ~/Documents/GitHub/tg   master  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib"
flipp3rrr  ~/Documents/GitHub/tg   master  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include"
flipp3rrr  ~/Documents/GitHub/tg   master  ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for library containing clock_gettime... none required
checking for library containing backtrace... none required
checking for event_base_new in -levent... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking event2/event.h usability... yes
checking event2/event.h presence... yes
checking for event2/event.h... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
configure: error: No openssl found. With --disable-openssl, libtgl will use libgcrypt instead.
✘ flipp3rrr  ~/Documents/GitHub/tg   master  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
flipp3rrr  ~/Documents/GitHub/tg   master  ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for library containing clock_gettime... none required
checking for library containing backtrace... none required
checking for event_base_new in -levent... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking event2/event.h usability... yes
checking event2/event.h presence... yes
checking for event2/event.h... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking if zlib is wanted... yes
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for rl_save_prompt in -lreadline... yes
checking for libconfig... enabled
checking for config_init in -lconfig... yes
checking for liblua... enabled
checking for lua... /usr/local/bin/lua
checking if /usr/local/bin/lua is a Lua interpreter... yes
checking for lua version... 5.3
checking for lua platform... unknown
checking for lua script directory... ${prefix}/share/lua/5.3
checking for lua module directory... ${exec_prefix}/lib/lua/5.3
checking if LUA_VERSION is defined... yes
checking lua.h usability... no
checking lua.h presence... no
checking for lua.h... no
checking lualib.h usability... no
checking lualib.h presence... no
checking for lualib.h... no
checking lauxlib.h usability... no
checking lauxlib.h presence... no
checking for lauxlib.h... no
checking luaconf.h usability... no
checking luaconf.h presence... no
checking for luaconf.h... no
checking for Lua headers in... /usr/local/include/lua5.3
checking lua.h usability... yes
checking lua.h presence... yes
checking for lua.h... yes
checking lualib.h usability... yes
checking lualib.h presence... yes
checking for lualib.h... yes
checking lauxlib.h usability... yes
checking lauxlib.h presence... yes
checking for lauxlib.h... yes
checking luaconf.h usability... yes
checking luaconf.h presence... yes
checking for luaconf.h... yes
checking for Lua header version... 5.3
checking if Lua header version matches 5.3... yes
checking if LUA_VERSION is defined... yes
checking for library containing exp... none required
checking for library containing dlopen... none required
checking for library containing lua_load... -llua5.3
checking for python... disabled
checking for libjansson... enabled
checking for json_array_set_new in -ljansson... yes
checking progname... default
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking mach/mach.h usability... yes
checking mach/mach.h presence... yes
checking for mach/mach.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for inline... inline
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for alarm... yes
checking for endpwent... yes
checking for memset... yes
checking for memmove... yes
checking for mkdir... yes
checking for select... yes
checking for socket... yes
checking for strdup... yes
checking for strndup... yes
checking for uname... yes
checking for __builtin_bswap32... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
flipp3rrr  ~/Documents/GitHub/tg   master  make
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/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
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/tl-parser -c -MP -MD -MF dep/tlc.d -MQ objs/tlc.o -o objs/tlc.o tgl/tl-parser/tlc.c
gcc objs/tl-parser.o objs/tlc.o -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -L/lib -L/usr/local/Cellar/openssl@1.1/1.1.1h/lib -rdynamic -ggdb -levent -ljansson -lconfig -lz -levent   -lreadline -llua5.3  -lssl -lcrypto -ldl -lpthread -lutil -o bin/tl-parser
ld: warning: directory not found for option '-L/lib'
bin/tl-parser -e auto/scheme.tlo auto/scheme.tl
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/generate.d -MQ objs/generate.o -o objs/generate.o tgl/generate.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/tools.d -MQ objs/tools.o -o objs/tools.o tgl/tools.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/rand_openssl.d -MQ objs/crypto/rand_openssl.o -o objs/crypto/rand_openssl.o tgl/crypto/rand_openssl.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/rand_altern.d -MQ objs/crypto/rand_altern.o -o objs/crypto/rand_altern.o tgl/crypto/rand_altern.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/err_openssl.d -MQ objs/crypto/err_openssl.o -o objs/crypto/err_openssl.o tgl/crypto/err_openssl.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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/err_altern.d -MQ objs/crypto/err_altern.o -o objs/crypto/err_altern.o tgl/crypto/err_altern.c
gcc objs/generate.o objs/tools.o objs/crypto/rand_openssl.o objs/crypto/rand_altern.o objs/crypto/err_openssl.o objs/crypto/err_altern.o -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -L/lib -L/usr/local/Cellar/openssl@1.1/1.1.1h/lib -rdynamic -ggdb -levent -ljansson -lconfig -lz -levent   -lreadline -llua5.3  -lssl -lcrypto -ldl -lpthread -lutil -o bin/generate
ld: warning: directory not found for option '-L/lib'
bin/generate -g skip-header auto/scheme.tlo > auto/auto-skip.h  || ( rm auto/auto-skip.h && false )
bin/generate -g fetch-header auto/scheme.tlo > auto/auto-fetch.h  || ( rm auto/auto-fetch.h && false )
bin/generate -g store-header auto/scheme.tlo > auto/auto-store.h  || ( rm auto/auto-store.h && false )
bin/generate -g autocomplete-header auto/scheme.tlo > auto/auto-autocomplete.h  || ( rm auto/auto-autocomplete.h && false )
bin/generate -g types-header auto/scheme.tlo > auto/auto-types.h  || ( rm auto/auto-types.h && false )
bin/tl-parser -E auto/scheme.tl 2> auto/scheme2.tl  || ( cat auto/scheme2.tl && rm auto/scheme2.tl && false )
awk -f ./tgl/gen_constants_h.awk < auto/scheme2.tl > auto/constants.h
bin/generate -g fetch-ds-header auto/scheme.tlo > auto/auto-fetch-ds.h  || ( rm auto/auto-fetch-ds.h && false )
bin/generate -g free-ds-header auto/scheme.tlo > auto/auto-free-ds.h  || ( rm auto/auto-free-ds.h && false )
bin/generate -g store-ds-header auto/scheme.tlo > auto/auto-store-ds.h  || ( rm auto/auto-store-ds.h && false )
bin/generate -g print-ds-header auto/scheme.tlo > auto/auto-print-ds.h  || ( rm auto/auto-print-ds.h && false )
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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 -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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 -c -MP -MD -MF dep/loop.d -MQ objs/loop.o -o objs/loop.o loop.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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 -c -MP -MD -MF dep/interface.d -MQ objs/interface.o -o objs/interface.o interface.c
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -I/usr/local/include -I/include -I/usr/local/include/lua5.3 -I/usr/local/Cellar/openssl@1.1/1.1.1h/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 -c -MP -MD -MF dep/lua-tg.d -MQ objs/lua-tg.o -o objs/lua-tg.o lua-tg.c
lua-tg.c:664:27: error: unused function 'get_peer' [-Werror,-Wunused-function]
static inline tgl_peer_t *get_peer (const char *s) {
                          ^
1 error generated.
make: *** [objs/lua-tg.o] Error 1
Paulchen232 commented 4 years ago

You can the line comments out. Comments out alle lines from this function. //static inline tgl_peer_t *get_peer (const char *s) { // return tgl_peer_get_by_name (TLS, s); //}