@gd1xza

Ошибка компиляции C?

Есть такой репозиторий на гх.
И мне вот вдруг понадобилось его скомпилировать.
Там 1 сурс и мейкфайл.
Устанавливаю все зависимости
Пишу make
Ошибка:
root@io:~/minecraft-dissector# make
gcc -c -DHAVE_CONFIG_H -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DINET6 -D_U_=__attribute__\(\(unused\)\) -Wall -Wpointer-arith -g -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -fPIC -DPIC packet-minecraft.c -o packet-minecraft.o
packet-minecraft.c: In function ‘proto_register_minecraft’:
packet-minecraft.c:164:15: warning: variable ‘module’ set but not used [-Wunused-but-set-variable]
     module_t *module;
               ^~~~~~
packet-minecraft.c: In function ‘proto_reg_handoff_minecraft’:
packet-minecraft.c:311:52: warning: passing argument 1 of ‘create_dissector_handle’ from incompatible pointer type [-Wincompatible-pointer-types]
         minecraft_handle = create_dissector_handle(dissect_minecraft, proto_minecraft);
                                                    ^~~~~~~~~~~~~~~~~
In file included from packet-minecraft.c:28:0:
/usr/include/wireshark/epan/packet.h:550:34: note: expected ‘dissector_t {aka int (*)(struct tvbuff *, struct _packet_info *, struct _proto_node *, void *)}’ but argument is of type ‘void (*)(tvbuff_t *, packet_info *, proto_tree *) {aka void (*)(struct tvbuff *, struct _packet_info *, struct _proto_node *)}’
 WS_DLL_PUBLIC dissector_handle_t create_dissector_handle(dissector_t dissector,
                                  ^~~~~~~~~~~~~~~~~~~~~~~
packet-minecraft.c:312:9: warning: implicit declaration of function ‘dissector_add’ [-Wimplicit-function-declaration]
         dissector_add("tcp.port", 25565, minecraft_handle);
         ^~~~~~~~~~~~~
packet-minecraft.c: In function ‘add_time_details’:
packet-minecraft.c:342:13: warning: variable ‘time’ set but not used [-Wunused-but-set-variable]
     guint64 time;
             ^~~~
packet-minecraft.c: In function ‘dissect_minecraft_message’:
packet-minecraft.c:543:9: warning: implicit declaration of function ‘check_col’ [-Wimplicit-function-declaration]
     if (check_col(pinfo->cinfo, COL_PROTOCOL))
         ^~~~~~~~~
packet-minecraft.c:551:51: error: ‘packet_info {aka struct _packet_info}’ has no member named ‘match_port’; did you mean ‘match_uint’?
         col_add_fstr(pinfo->cinfo, COL_INFO, pinfo->match_port == pinfo->destport ? "C->S" : "S->C" ": %d > %d Info Type:[%s]",
                                                   ^~
packet-minecraft.c: In function ‘get_minecraft_packet_len’:
packet-minecraft.c:801:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
         printf("Unknown packet: 0x%x\n", type);
         ^~~~~~
packet-minecraft.c:801:9: warning: incompatible implicit declaration of built-in function ‘printf’
packet-minecraft.c:801:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
Makefile:21: recipe for target 'packet-minecraft.o' failed
make: *** [packet-minecraft.o] Error 1

C не знаю
думаю может ошибка изза совместимости версий языка
gcc 6.3.0
  • Вопрос задан
  • 104 просмотра
Пригласить эксперта
Ответы на вопрос 1
CityCat4
@CityCat4
Если я чешу в затылке - не беда!
incompatible implicit declaration of built-in function ‘printf’

Вот это ни на какие мысли не наводит?
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы