aresrpg / minecraft-dissector

A wireshark dissector for the Minecraft protocol using https://github.com/PrismarineJS/minecraft-data
56 stars 28 forks source link

Build fails to find <config.h> #6

Open RunningDroid opened 2 years ago

RunningDroid commented 2 years ago
cc -fPIC -pthread -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -c -o packet-minecraft.o packet-minecraft.c
packet-minecraft.c:1:10: fatal error: config.h: No such file or directory
    1 | #include <config.h>
      |          ^~~~~~~~~~
compilation terminated.
make: *** [<builtin>: packet-minecraft.o] Error 1

Without that line it fails differently:

cc -fPIC -pthread -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -c -o packet-minecraft.o packet-minecraft.c
packet-minecraft.c:13:49: error: 'VERSION_MAJOR' undeclared here (not in a function)
   13 | WS_DLL_PUBLIC_DEF const int plugin_want_major = VERSION_MAJOR;
      |                                                 ^~~~~~~~~~~~~
packet-minecraft.c:14:49: error: 'VERSION_MINOR' undeclared here (not in a function)
   14 | WS_DLL_PUBLIC_DEF const int plugin_want_minor = VERSION_MINOR;
      |                                                 ^~~~~~~~~~~~~
packet-minecraft.c: In function 'plugin_register':
packet-minecraft.c:315:12: error: unknown type name 'proto_plugin'
  315 |     static proto_plugin plug;
      |            ^~~~~~~~~~~~
packet-minecraft.c:317:9: error: request for member 'register_protoinfo' in something not a structure or union
  317 |     plug.register_protoinfo = proto_register_minecraft;
      |         ^
packet-minecraft.c:318:9: error: request for member 'register_handoff' in something not a structure or union
  318 |     plug.register_handoff = proto_reg_handoff_minecraft;
      |         ^
packet-minecraft.c:319:5: warning: implicit declaration of function 'proto_register_plugin'; did you mean 'proto_register_prefix'? [-Wimplicit-function-declaration]
  319 |     proto_register_plugin(&plug);
      |     ^~~~~~~~~~~~~~~~~~~~~
      |     proto_register_prefix
make: *** [<builtin>: packet-minecraft.o] Error 1
DeltaEvo commented 2 years ago

Could you share your OS and your Wireshark version ?

RunningDroid commented 2 years ago

I'm using Void Linux and Wireshark version 3.4.5

lilithium-hydride commented 1 year ago

Same issue here on Artix Linux, wireshark-qt version 4.0.2-1. pacman -F config.h does not pull up anything for Wireshark.

schnism commented 1 year ago

In case someone stumbles over this: config.h is really missing, but only two defines are needed.

So in packet-minecraft.c if you delete the

include config.h

and add

define VERSION_MAJOR 4

define VERSION_MINOR 0

instead, all fine. I will submit a pull request but I am afraid this project is no longer maintained?

DeltaEvo commented 1 year ago

This project is indeed no longer maintained but I'm up to review and merge PRs, however your PR is not the ideal way to solve this.

This is an interesting information anyway that it's able to compile and work without the config.h, i'll try to take a quick look to see if I canno't use something else to get the wireshark version :thinking: