Hotboot Snippet

Posted by Yourdrunkendad on Sun 10 Aug 2003 04:04 PM — 4 posts, 18,489 views.

#0
I'm trying to implement Samsons hotboot snippet into my mud. The one from alsherok.net. I'm compiling with Cygwin in WindowsXP. However when I do so I'm getting the following errors during the compile:

In file included from mud.h:348,
from act_comm.c:32:
hotboot.h:41: field 'hotboot_recover" declared as a function
hotboot.h:42: field 'load_world' declared as a function
hotboot.h:44: field 'do_hotboot' declared as a function
make[1]: *** [act_comm.o] Error 1
make[1]: Leaving directory '/home/jimmy scrabes/smaug/src'
make: *** [all] Error 2


can anyone help me out?
USA #1
For clarification purposes - lines 41-44 in hotboot.h are:


void hotboot_recover( void );
void load_world( CHAR_DATA *ch );

DECLARE_DO_FUN( do_hotboot ); /* Hotboot command - Samson 3-31-01 */


As advised by myself, he's already tried changing the first 2 to:

void hotboot_recover args( ( void ) );
void load_world args( ( CHAR_DATA *ch ) );

But that didn't change anything. I wasn't sure how to handle the DECLARE_DO_FUN part, especially since I'm running the latest Cygwin and wasn't able to reproduce a similar situation.
Australia Forum Administrator #2
Yes, I see what the problem is. :)

The instructions from Samson and others say:


   Then locate the following code:

/*
 * Structure for extended bitvectors -- Thoric
 */
struct extended_bitvector
{
    unsigned int		bits[XBI]; 
   /* Needs to be unsigned to compile in Redhat 6 - Samson */
};

   Directly below that, add the following:

#include "hotboot.h"



So, your code should look like this:


/*
 * Structure for extended bitvectors -- Thoric
 */
struct extended_bitvector
{
    int		bits[XBI];
};

#include "hotboot.h"



However you have put the include at line 348 (see your error message). That means you put it at the wrong place, inside the structure, like this:


/*
 * Structure for extended bitvectors -- Thoric
 */
struct extended_bitvector
{
    int		bits[XBI];
#include "hotboot.h"  // line 348 
};


If you do that, you get that exact error message. Move the include to below the closing "};" as instructed in the original instructions.


Amended on Sun 10 Aug 2003 11:22 PM by Nick Gammon
#3
Thanks guys, Samson & Gammon for providing the codes for the community and helping out morons like me make them work. You were right about the #include hotboot.h being inside the function instead of after it.

However when I fixed that I was still getting the exact same errors, so before I posted again harassing you guys, I went through the whole snippet installation process again, and then again just to make sure. Everything was absolutely perfect and it still wouldn't work.

This information is for anyone else who has/will encounter this or a similar problem since I know these forums are saved and searchable.

I use the following codebase:

http://www.gammon.com.au/files/smaug/smaug1.4a_mxp.tgz

Compiled using Cygwin DLL release version is 1.3.22-1
In a WindowsXP environment, Service Pack 1 installed
On an AthlonXP 1900+

To make the snippet work I followed the instructions exactly, except for the instruction to put #include hotboot.h into mud.h. Instead I simply added hotboot.h, hotboot.c, and hotboot.o to their respective areas in the makefile. Did a make clean/make
...joined the game, added command using:

cedit hotboot create do_hotboot

... and I am pleased to say it now works perfectly.
Hopefully this helps someone out there.