make时出错,C ++'db.c:2127:错误:预期为';'在“ ||”之前令牌”

        if ((mob_index[ZCMD.arg1].virtual < 7999) &&
        (mob_index[ZCMD.arg1].virtual > 7899) ) {
          do {
        to_room = number(0, top_of_world);
          }
          while( (IS_SET_AR(world[to_room].room_flags,ROOM_PRIVATE))
             ||(IS_SET_AR(world[to_room].room_flags,ROOM_GODROOM))
             ||(IS_SET_AR(world[to_room].room_flags,ROOM_DEATH))
             ||(IS_SET_AR(world[to_room].room_flags,ROOM_NOMOB))
             ||(IS_SET_AR(world[to_room].room_flags,ROOM_HOUSE))
             ||(IS_SET_AR(world[to_room].room_flags,ROOM_ATRIUM))
             ||(world[to_room].sector_type == SECT_CITY)
             || (zone_table[world[to_room].zone].number == 36) )
             || (zone_table[world[to_room].zone].number == 198) )
             || (zone_table[world[to_room].zone].number == 100) )
             || (zone_table[world[to_room].zone].number == 187) )
             || (zone_table[world[to_room].zone].number == 145) )
             || (zone_table[world[to_room].zone].number == 70) )
             || (zone_table[world[to_room].zone].number == 163) );

我运行基于C ++的MUD或文本RPG,我试图在代码中添加一些内容。尝试运行时,出现以下错误:

db.c:2127: error: expected ';' before '||' token
make[3]: *** [db.o] Error 1
make[3]: Leaving directory `/home/dpreturn/darkpawnsbuild/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/dpreturn/darkpawnsbuild/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/dpreturn/darkpawnsbuild/src'
make: *** [all-recursive] Error 1```

评论
  • 一南
    一南 回复

    你需要数一数括号

    || (zone_table[world[to_room].zone].number == 36) )
    

    应该

    || (zone_table[world[to_room].zone].number == 36)
    

    等等等