[NEWBIE] [CODE]

From: King Mundi (Kingmundi@AOL.COM)
Date: 11/27/97


circle30bpl12.zip
from the www.circlemud.org site

got it to compile for windows95 using borland c++ 5.01 after modifying it fo
the following 4 error messages, comments about error messages follow at end
of message

ERROR 1
Error:  INTERPRETER.H(20,39):Undefined structure 'command_info'
in interpreter.h
the following code

/* necessary for CMD_IS macro */
#ifndef __INTERPRETER_C__
extern struct command_info cmd_info[];
#endif

can be cut and pasted to move it below
the following code

struct command_info {
   char *command;
   byte minimum_position;
   void (*command_pointer)
   (struct char_data *ch, char * argument, int cmd, int subcmd);
   sh_int minimum_level;
   int  subcmd;
};

then save the file intrepreter.h

ERROR 2
Error:  act.other.c(728,20):Undefined structure 'stat'
open conf.h and add
the following code

#define HAVE_SYS_STAT_H

then save the file conf.h

ERROR 3
Error:  spells.c(25,38):Undefined structure 'cha_app_type'
open spell.c and comment out
the following code

extern struct cha_app_type cha_app[];

then save the file spell.c

ERROR 4
Error:  Error: Unresolved external '__chdir' referenced from module comm.c
open comm.c and comment out
the following code

  if (chdir(dir) < 0) {
    perror("SYSERR: Fatal error changing to data directory");
    exit(1);
  }

then save the file comm.c

for error 1
would you not have to first define struct command_info before you can declare
extern command_info cmd_info[]  ?  why would this code compile for everyone
else and only give borland's compiler trouble?

for error 2
does msvc++ somehow automatically include sys/stat.h ? i figure this is why
borland's compiler needs the addition of the #define

for error 3
i could not find where struct cha_app_type was declared, did i miss it ?

for error 4
could someone explain the concept of unresolved external variables ? i am
very amateur programmer, i assume that somehwere chdir is declared twice and
it can not determine which to use, or that it is not declared at all?


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST