TomenetGame / tomenet

TomeNET is an online multiplayer roguelike role-playing game
https://www.tomenet.eu/
Other
70 stars 12 forks source link

Problems with cross-compiling server #10

Closed Tokariew closed 4 years ago

Tokariew commented 4 years ago

I had some problems with cross-compiling latest changes on server…

server/party.c: In function 'sf_rename':
server/party.c:4575:15: error: storage size of 'stbuf' isn't known
 4575 |   struct stat stbuf;
      |               ^~~~~
server/party.c:4595:7: warning: implicit declaration of function 'fstat' [-Wimplicit-function-declaration]
 4595 |   if (fstat(fd1, &stbuf) == -1) {
      |       ^~~~~
server/party.c:4575:15: warning: unused variable 'stbuf' [-Wunused-variable]
 4575 |   struct stat stbuf;
      |               ^~~~~
make: *** [makefile.mingw:305: server/party.o] Error 1
server/util.c: In function 'console_talk_aux':
server/util.c:5657:7: error: 'i' undeclared (first use in this function)
 5657 |  for (i = 1; i <= NumPlayers; i++) {
      |       ^
server/util.c:5657:7: note: each undeclared identifier is reported only once for each function it appears in
make: *** [makefile.mingw:305: server/util.o] Error 1

tried with mingw-gcc-9.21

fix for second was simple, not sure why mingw-gcc doesn't work in this case… for first i just reverted changes in ba5465118faabe318345b48bd8083281b66f5db1 which is probably not nice

Normal compiling with gcc 10.2.1 on fedora is fine…

Tokariew commented 4 years ago

found a fix…

missing LDFLAGS option in makefile.mingw

$(TOLUA): $(TOLUAOBJS) server/lua/tolua.c server/lua/tolualua.c
        $(CC) $(LUACFLAGS) $(LDFLAGS) -o $@ $(TOLUAOBJS) server/lua/tolua.c server/lua/tolualua.c $(LUALIBS)
Tokariew commented 4 years ago

Sorry not fixed for me somehow messed up branches, with deleted code function :|

mhirki commented 4 years ago

Fixed by commit 17d2ee3e0d66877716fba2fc777d1b5bdaa1c0cf.