Re: [Newbie][Code] Mob Progs undefined errors.

From: Methos (methos@first-rule.net)
Date: 02/13/03


> CircleMUD version: bpl18 (Del's Bundle)
> OS: Windows 95

> errors. I set the thing in Oasis.h to 1 of course. I just don't know what
> went wrong here:
>
> medit.o: In function `medit_disp_mprog_types':
> /home/Maria Bonita/BroodwarsMUd/src/medit.c:321: undefined reference to
> `mobprog_types'
> mobcmd.o: In function `do_mpjunk':
> /home/Maria Bonita/BroodwarsMUd/src/mobcmd.c:231: undefined reference to
> `get_object_in_equip_vis'
> /home/Maria Bonita/BroodwarsMUd/src/mobcmd.c:249: undefined reference to
> `get_object_in_equip_vis'
> collect2: ld returned 1 exit status
> make[1]: *** [../bin/circle] Error 1
> make[1]: Leaving directory `/home/Maria Bonita/BroodwarsMUd/src'
> make: *** [all] Error 2
>
> medit.c
> Line 321:
> sprintf(buf, "%s%2d%s) %s\r\n", grn, i, nrm, mobprog_types[i]);
>
> mobcmd.o
> Line 231:
> if ((obj=get_object_in_equip_vis(ch, arg, ch->equipment,&pos))!= NULL) {
>
> Line 249:
>
> while((obj=get_object_in_equip_vis(ch, arg, ch->equipment, &pos))!=NULL){

Im no pro but Ive added the mobprogs in before.
Make sure you have this in your constants.c and OASIS_MPROG define should be
1

#if defined(OASIS_MPROG)
const char *mobprog_types[] = {
  "INFILE",
  "ACT",
  ..etc.
  "\n"
};
#endif

For the other 2 errors make sure you have:

#include "handler.h"

In your mobcmd.c file, here is the get_object_in_equip_vis code incase you
dont have it:

Make sure this is in handler.c:

struct obj_data *get_object_in_equip_vis(struct char_data * ch,
                           char *arg, struct obj_data * equipment[], int *j)
{
  for ((*j) = 0; (*j) < NUM_WEARS; (*j)++)
    if (equipment[(*j)])
      if (CAN_SEE_OBJ(ch, equipment[(*j)]))
        if (isname(arg, equipment[(*j)]->name))
          return (equipment[(*j)]);

  return NULL;
}

And this in handler.h:

struct obj_data *get_object_in_equip_vis(struct char_data *ch, char *arg,
struct obj_data *equipment[], int *j);


Hope this helps you some.

Ken Southern

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT