minecraft-dissector icon indicating copy to clipboard operation
minecraft-dissector copied to clipboard

Build fails to find <config.h>

Open RunningDroid opened this issue 2 years ago • 5 comments

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

RunningDroid avatar Feb 23 '22 19:02 RunningDroid

Could you share your OS and your Wireshark version ?

DeltaEvo avatar Feb 23 '22 21:02 DeltaEvo

I'm using Void Linux and Wireshark version 3.4.5

RunningDroid avatar Feb 26 '22 05:02 RunningDroid

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

lilithium-hydride avatar Dec 24 '22 20:12 lilithium-hydride

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?

schnism avatar Jun 26 '23 18:06 schnism

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:

DeltaEvo avatar Jun 27 '23 06:06 DeltaEvo