IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

GTK+ avec C & C++ Discussion :

erreur de compilation


Sujet :

GTK+ avec C & C++

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 14
    Par défaut erreur de compilation
    bonjour j'obtiens c erreurs de compilation
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     
    PI1.c:1: erreur: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘buffer’
    PI1.c:1: erreur: caractère ' de terminaison manquant
    PI1.c:2: erreur: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘you’
    PI1.c:3: erreur: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘enter’
    PI1.c:3: erreur: caractère ' de terminaison manquant
    In file included from PI1.c:5:
    /usr/include/stdlib.h:140: erreur: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘__ctype_get_mb_cur_max’
    In file included from /usr/include/glib-2.0/glib.h:39,
                     from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                     from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
                     from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
                     from /usr/include/gtk-2.0/gdk/gdk.h:30,
                     from /usr/include/gtk-2.0/gtk/gtk.h:31,
                     from PI1.c:7:
    /usr/include/glib-2.0/glib/gconvert.h:54: erreur: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘g_iconv’
    PI1.c: In function ‘reculer_pion_joueur’:
    PI1.c:14: erreur: expected ‘=’, ‘,’, ‘;’, ‘asmor ‘__attribute__’ before ‘int’
    PI1.c:197: erreur: expected ‘{’ at end of input
    VOICI mon code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
     
    #include <stdlib.h>
    #include <stdio.h>
    #include <gtk/gtk.h>
    typedef int Tableau[7];
     
    void reculer_pion_joueur(GtkWidget *widget, gpointer data)
    void jouer_carte_joueur(GtkWidget *widget, gpointer data)
     
     
    int main(int argc, char **argv)
    {   int i;
        int k;
        int j;
        Tableau t;
        GtkWidget *pWindow;
        GtkWidget *pTable;
        GtkWidget *pButton[2000];
        GtkWidget *pCARTE[1000];
        GtkWidget *pMAIN[10] ;
        GtkWidget *pBMAIN[1000] ;  
        GtkWidget *pNBCARTE[10000];
        GtkWidget *l1 ;
        gtk_init(&argc, &argv);
     
        pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_default_size(GTK_WINDOW(pWindow),800 , 600);
        gtk_window_set_title(GTK_WINDOW(pWindow), "CARTAGENA");
        g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(gtk_main_quit), NULL);
     
     
     
      /*Creation des images */
     
     
        pCARTE[1] = gtk_image_new_from_file ("./CARTE1.png");
        pCARTE[2] = gtk_image_new_from_file ("./CARTE2.png");
        pCARTE[3] = gtk_image_new_from_file ("./CARTE3.png");
        pCARTE[4] = gtk_image_new_from_file ("./CARTE4.png");
        pCARTE[5] = gtk_image_new_from_file ("./CARTE5.png");
        pCARTE[6] = gtk_image_new_from_file ("./CARTE6.png");
        pCARTE[7] = gtk_image_new_from_file ("./CARTE7.png");
        pCARTE[8] = gtk_image_new_from_file ("./CARTE2.png");
        pCARTE[9] = gtk_image_new_from_file ("./CARTE3.png");
        pCARTE[10] = gtk_image_new_from_file ("./CARTE4.png");
        pCARTE[11] = gtk_image_new_from_file ("./CARTE5.png");
        pCARTE[12] = gtk_image_new_from_file ("./CARTE6.png");
        pCARTE[13] = gtk_image_new_from_file ("./CARTE7.png");
        pCARTE[14] = gtk_image_new_from_file ("./CARTE2.png");
        pCARTE[15] = gtk_image_new_from_file ("./CARTE3.png");
        pCARTE[16] = gtk_image_new_from_file ("./CARTE4.png");
        pCARTE[17] = gtk_image_new_from_file ("./CARTE5.png");
        pCARTE[18] = gtk_image_new_from_file ("./CARTE6.png");
        pCARTE[19] = gtk_image_new_from_file ("./CARTE7.png");
        pCARTE[20] = gtk_image_new_from_file ("./CARTE2.png");
        pCARTE[21] = gtk_image_new_from_file ("./CARTE3.png");
        pCARTE[22] = gtk_image_new_from_file ("./CARTE4.png");
        pCARTE[23] = gtk_image_new_from_file ("./CARTE5.png");
        pCARTE[24] = gtk_image_new_from_file ("./CARTE6.png");
        pCARTE[25] = gtk_image_new_from_file ("./CARTE7.png");
        pCARTE[26] = gtk_image_new_from_file ("./CARTE2.png");
        pCARTE[27] = gtk_image_new_from_file ("./CARTE3.png");
        pCARTE[28] = gtk_image_new_from_file ("./CARTE4.png");
        pCARTE[29] = gtk_image_new_from_file ("./CARTE5.png");
        pCARTE[30] = gtk_image_new_from_file ("./CARTE6.png");
        pCARTE[31] = gtk_image_new_from_file ("./CARTE7.png");
        pCARTE[32] = gtk_image_new_from_file ("./CARTE2.png");
        pCARTE[33] = gtk_image_new_from_file ("./CARTE3.png");
        pCARTE[34] = gtk_image_new_from_file ("./CARTE4.png");
        pCARTE[35] = gtk_image_new_from_file ("./CARTE5.png");
        pCARTE[36] = gtk_image_new_from_file ("./CARTE6.png");
        pCARTE[37] = gtk_image_new_from_file ("./CARTE7.png");
     
     
     /*Creation de la main du joueur */
     
     
        pMAIN[1] = gtk_image_new_from_file ("./CARTE1.png");
        pMAIN[2] = gtk_image_new_from_file ("./CARTE2.png");
        pMAIN[3] = gtk_image_new_from_file ("./CARTE3.png");
        pMAIN[4] = gtk_image_new_from_file ("./CARTE4.png");
        pMAIN[5] = gtk_image_new_from_file ("./CARTE5.png");
        pMAIN[6] = gtk_image_new_from_file ("./CARTE6.png");
        pMAIN[7] = gtk_image_new_from_file ("./CARTE7.png");
     
     
         /* Creation et insertion de la table 7 lignes 21 colonnes */
     
        pTable=gtk_table_new(7,21,TRUE);
        gtk_container_add(GTK_CONTAINER(pWindow), GTK_WIDGET(pTable));
     
        /* Creation des boutons */
     
        pButton[0] = gtk_toggle_button_new ();
        gtk_button_set_image(pButton[0],pCARTE[1]);
     
        for (i=1; i<=38; i++) {
     
          pButton[i] = gtk_toggle_button_new ();
          gtk_button_set_image(pButton[i],pCARTE[i+1]);
     
    }
     
        pButton[38]= gtk_button_new_with_label("Qu");
        pButton[39]= gtk_button_new_with_label("PC");
     
     
        /* Insertion des boutons */
     
        /* Affichage du pacours */
     
     for (i=1; i<=19; i++) {
     
       gtk_table_attach_defaults(GTK_TABLE(pTable), pButton[i-1],
    			   i,i+1 , 1, 2);
     
     
       gtk_table_attach_defaults(GTK_TABLE(pTable), pButton[18+i],
    			   i,i+1 ,3 , 4);
     
    }
     
     /* affichage des boutons quitter et piocher carte*/
     
        gtk_table_attach_defaults(GTK_TABLE(pTable), pButton[38],
    			      19, 20 , 8, 9);
        gtk_table_attach_defaults(GTK_TABLE(pTable), pButton[39],
    	18, 19 , 8, 9);
     
     
     
     
      /*Afficahge de la main du joueur */
        l1=gtk_label_new("La Main") ;
     
          gtk_table_attach_defaults(GTK_TABLE(pTable), l1,
    				1,4, 4, 5);
     for (j=1; j<=6; j++) 
        {t[j]=j;}
     
     k=1;
     
      for (i=1; i<=6; i++) {
        for (j=1; j<=t[i]; j++) { 
     
                           pBMAIN[k] = gtk_toggle_button_new ();
    		       if (i==1) pNBCARTE[k] = gtk_image_new_from_file ("./CARTE2.png");
    		       if (i==2) pNBCARTE[k] = gtk_image_new_from_file ("./CARTE3.png");
    		       if (i==3) pNBCARTE[k] = gtk_image_new_from_file ("./CARTE4.png");
    		       if (i==4) pNBCARTE[k] = gtk_image_new_from_file ("./CARTE5.png");
    		       if (i==5) pNBCARTE[k] = gtk_image_new_from_file ("./CARTE6.png");
    		       if (i==6) pNBCARTE[k] = gtk_image_new_from_file ("./CARTE7.png");
     
    		       gtk_button_set_image(pBMAIN[k],pNBCARTE[k]);
     
     
          gtk_table_attach_defaults(GTK_TABLE(pTable), pBMAIN[k],
    				k,k+1 , 5, 6);
          k=k+1 ;
     
    }
     
      }
     
     
     
       /* Connexion du signal "destroy" de la fenetre */
        g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(gtk_main_quit), NULL);
     
     
        /* Connexion du signal "clicked" du bouton */
        g_signal_connect(G_OBJECT(pButton[38]), "clicked", G_CALLBACK(gtk_main_quit), NULL);
     
      /* Connexion du signal "clicked" du bouton */
     
         for (i=1; i<=6; i++) {
           g_signal_connect(G_OBJECT(pBMAIN[i]), "clicked", G_CALLBACK(jouer_carte_joueur), NULL);}
     
     
      /* Connexion du signal "clicked" du bouton */
     
         for (i=0; i<=37; i++) {
      g_signal_connect(G_OBJECT(pButton[i]), "clicked", G_CALLBACK(reculer_pion_joueur), NULL);
      }
     
     
     
     
     
      gtk_widget_show_all(pWindow);
     
     
      gtk_main();
        return EXIT_SUCCESS ;}
    Quelqu un peut il m'expliquer s'il vous plait
    Merci d'avance

  2. #2
    Membre Expert
    Homme Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 259
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 259
    Par défaut
    Des ; à la fin des prototypes de fonction ca ne ferait pas de mal...

Discussions similaires

  1. Erreur de compilation après modification du Uses
    Par DevelOpeR13 dans le forum Langage
    Réponses: 5
    Dernier message: 30/10/2007, 14h23
  2. Réponses: 2
    Dernier message: 23/09/2003, 14h32
  3. Réponses: 10
    Dernier message: 22/09/2003, 21h58
  4. Réponses: 4
    Dernier message: 27/08/2003, 21h34
  5. Réponses: 2
    Dernier message: 04/03/2003, 23h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo