hackerschoice / gsocket-relay

Global Socket Server
Other
26 stars 8 forks source link

make error #3

Closed jhonnybonny closed 1 month ago

jhonnybonny commented 2 months ago
make  all-recursive
make[1]: Entering directory '/root/gsocket-relay'
Making all in src
make[2]: Entering directory '/root/gsocket-relay/src'
gcc -DHAVE_CONFIG_H -I. -I..   -I/root/gsocket-relay/gsocket/include -I/usr/local/include -I/usr/include   -O2 -Wall -g -O2 -MT gsrnd-engine.o -MD -MP -MF .deps/gsrnd-engine.Tpo -c -o gsrnd-engine.o `test -f 'engine.c' || echo './'`engine.c
engine.c: In function ‘gsrn_listen’:
engine.c:179:34: error: ‘GS_FL_PROTO_BUDDY_CHECK’ undeclared (first use in this function); did you mean ‘GS_FL_PROTO_SERVER_CHECK’?
  179 |                 if (msg->flags & GS_FL_PROTO_BUDDY_CHECK) {
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~
      |                                  GS_FL_PROTO_SERVER_CHECK
engine.c:179:34: note: each undeclared identifier is reported only once for each function it appears in
In file included from engine.c:24:
engine.c:180:50: error: ‘GS_STATUS_CODE_BUDDY_NOK’ undeclared (first use in this function); did you mean ‘GS_STATUS_CODE_SERVER_OK’?
  180 |                         GSRN_send_status_warn(p, GS_STATUS_CODE_BUDDY_NOK, NULL);
      |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~
protocol.h:11:86: note: in definition of macro ‘GSRN_send_status_warn’
   11 | #define GSRN_send_status_warn(p, c, m)      GSRN_send_status(p, GS_STATUS_TYPE_WARN, c, m);
      |                                                                                      ^
engine.c:182:42: error: ‘GS_FL_PROTO_CONN_CLOSE’ undeclared (first use in this function)
  182 |                         if (msg->flags & GS_FL_PROTO_CONN_CLOSE)
      |                                          ^~~~~~~~~~~~~~~~~~~~~~
engine.c: In function ‘cb_gsrn_connect’:
engine.c:340:25: error: ‘GS_FL_PROTO_BUDDY_CHECK’ undeclared (first use in this function); did you mean ‘GS_FL_PROTO_SERVER_CHECK’?
  340 |         if (msg.flags & GS_FL_PROTO_BUDDY_CHECK)
      |                         ^~~~~~~~~~~~~~~~~~~~~~~
      |                         GS_FL_PROTO_SERVER_CHECK
make[2]: *** [Makefile:580: gsrnd-engine.o] Error 1
make[2]: Leaving directory '/root/gsocket-relay/src'
make[1]: *** [Makefile:450: all-recursive] Error 1
make[1]: Leaving directory '/root/gsocket-relay'
make: *** [Makefile:356: all] Error 2
rm1984 commented 2 months ago

Hi, same error here while trying to compile on FreeBSD 14. After following the exact installation instructions, I get the following errors:

engine.c: In function 'gsrn_listen':
engine.c:179:34: error: 'GS_FL_PROTO_BUDDY_CHECK' undeclared (first use in this function); did you mean 'GS_FL_PROTO_SERVER_CHECK'?
  179 |                 if (msg->flags & GS_FL_PROTO_BUDDY_CHECK) {
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~
      |                                  GS_FL_PROTO_SERVER_CHECK
engine.c:179:34: note: each undeclared identifier is reported only once for each function it appears in
In file included from engine.c:24:
engine.c:180:50: error: 'GS_STATUS_CODE_BUDDY_NOK' undeclared (first use in this function); did you mean 'GS_STATUS_CODE_SERVER_OK'?
  180 |                         GSRN_send_status_warn(p, GS_STATUS_CODE_BUDDY_NOK, NULL);
      |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~
protocol.h:11:86: note: in definition of macro 'GSRN_send_status_warn'
   11 | #define GSRN_send_status_warn(p, c, m)      GSRN_send_status(p, GS_STATUS_TYPE_WARN, c, m);
      |                                                                                      ^
engine.c:182:42: error: 'GS_FL_PROTO_CONN_CLOSE' undeclared (first use in this function)
  182 |                         if (msg->flags & GS_FL_PROTO_CONN_CLOSE)
      |                                          ^~~~~~~~~~~~~~~~~~~~~~
engine.c: In function 'cb_gsrn_connect':
engine.c:340:25: error: 'GS_FL_PROTO_BUDDY_CHECK' undeclared (first use in this function); did you mean 'GS_FL_PROTO_SERVER_CHECK'?
  340 |         if (msg.flags & GS_FL_PROTO_BUDDY_CHECK)
      |                         ^~~~~~~~~~~~~~~~~~~~~~~
      |                         GS_FL_PROTO_SERVER_CHECK
*** Error code 1
loonydev commented 1 month ago

@jhonnybonny @rm1984 don't know if it's still actual, but.

Relay is compiled with the gsocket itself and relies on the definition of gsocket.h.

The problem that with commit 679dd248685577a3bd0463e58f050e9fcd56f94a at gsocket-realy were used defines from beta branch on gscoket, which missing on master.

So, to build relay, you need to build it against beta branch. Not sure about backward compatibility with master gsocket release, but at least it's builds.

$ sudo apt install make automake autoconf gcc libevent-dev libssl-dev
$ git clone --depth 1 https://github.com/hackerschoice/gsocket-relay.git
$ cd gsocket-relay
$ git clone -b beta --depth 1 https://github.com/hackerschoice/gsocket
$ (cd gsocket; ./bootstrap && ./configure && make)
$ ./bootstrap && ./configure && make

And now it's built. The only change is a -b beta.

I'm not sure whether such behavior should be in master or not since those definitions might include some functions related to it, but it's a good first issue to contribute to gsocket.

jhonnybonny commented 1 month ago

Thanks