Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → compilation error help please.

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 5

1 (edited by Dante 21.07.2012 14:32)

Topic: compilation error help please.

Could correct the error at compile time, I show the code you copy from your forum and error when compiling marking.

This is the code:

if (realcount>=1 && !game->bad)
      {
      if ( (game_get_type(game)==game_type_ladder ||
      game_get_type(game)==game_type_ironman ||
      game_get_type(game)==game_type_ironman ||
      game_get_type(game)==game_type_oneonone ||
      game_get_type(game)==game_type_melee ||
      game_get_type(game)==game_type_topvbot) &&
      (realcount==2) )
      {
      t_ladder_id id;

      if ( (game_get_type(game)==game_type_ladder ||
      game_get_type(game)==game_type_oneonone ||
      game_get_type(game)==game_type_melee ||
      game_get_type(game)==game_type_topvbot) )

      id = ladder_id_normal;
      else
      id = ladder_id_ironman;

      }

This is the error that brand, tell the compiled:

Error   134   error C2143: error de sintaxis : falta ';' delante de 'if'   C:\PvPGN\src\bnetd\game.cpp   620
Error   135   error C2143: error de sintaxis : falta ';' delante de '{'   C:\PvPGN\src\bnetd\game.cpp   621
Error   136   error C2447: '{' : falta el encabezado de función (¿lista formal de estilo anterior?)   C:\PvPGN\src\bnetd\game.cpp   621
Error   137   error C1075: se encontró el final del archivo antes de encontrar el elemento de cierre correspondiente a llave '{' en '\PvPGN\src\bnetd\game.cpp(46)'   C:\PvPGN\src\bnetd\game.cpp   2389

was compiled with the svn 1.99

Thanks for your time and help, I hope your answer.

2

Re: compilation error help please.

Show an entire file with that code.

Do not ask for support in PM.

3

Re: compilation error help please.

HarpyWar wrote:

Show an entire file with that code.

here I leave you an attachment of the code

4

Re: compilation error help please.

You just forgot to put the close bracket at the end of block IF.
Also "realcount" and "game" are not defined.

+ show spoiler

static int game_match_type(t_game_type type,const char *gametypes)
{
    if (realcount>=1 && !game->bad)
    {
        if ( (game_get_type(game)==game_type_ladder ||
            game_get_type(game)==game_type_ironman ||
            game_get_type(game)==game_type_ironman ||
            game_get_type(game)==game_type_oneonone ||
            game_get_type(game)==game_type_melee ||
            game_get_type(game)==game_type_topvbot) &&
            (realcount==2) )
        {
            t_ladder_id id;

            if ( (game_get_type(game)==game_type_ladder ||
                game_get_type(game)==game_type_oneonone ||
                game_get_type(game)==game_type_melee ||
                game_get_type(game)==game_type_topvbot) )

                id = ladder_id_normal;
            else
                id = ladder_id_ironman;

        }
    }

    char *p, *q;
    int res;

    if (!gametypes || !gametypes[0]) return 0;

    gametypes = p = xstrdup(gametypes);
    res = 0;
    do {
        q = std::strchr(p,',');
        if (q) *q = '\0';
        if (!strcasecmp(p,"topvbot")) {
            if (type == game_type_topvbot) { res = 1; break; }
        } else if (!strcasecmp(p,"melee")) {
            if (type == game_type_melee) { res = 1; break; }
        } else if (!strcasecmp(p,"ffa")) {
            if (type == game_type_ffa) { res = 1; break; }
        } else if (!strcasecmp(p,"oneonone")) {
            if (type == game_type_oneonone) { res = 1; break; }
        }
        if (q) p = q + 1;
    } while(q);

    free((void*)gametypes);
    return res;
}

Do not ask for support in PM.

5

Re: compilation error help please.

HarpyWar wrote:

You just forgot to put the close bracket at the end of block IF.

That's why - use real IDE to change the code. Use Magic Builder only if you want to compile ready code.

Posts: 5

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 1 guest, 0 registered users

forums.pvpgn.pro → [EN] The Source Code → compilation error help please.