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

Langage C++ Discussion :

Problème de namespace


Sujet :

Langage C++

Vue hybride

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

    Informations forums :
    Inscription : Octobre 2004
    Messages : 51
    Par défaut Problème de namespace
    Bonjour,

    J'essaie depuis quelques jours de crées un namespace dans code.
    Mais malgré avoir parcourue des tuto, je ne comprend pas comment les intégrer.

    En effet j'ai mon code source qui est dans un .cpp et les déclaration dans un .h.
    Voila mon code (ce qui sera plus simple):

    .h
    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
     
     
    #ifdef _WIN32
    #include <windows.h>
    #endif
    #include <stdio.h>
    #include <stdlib.h>
    #ifndef __APPLE__
    #include <GL/gl.h>
    #include <GL/glut.h>
    #else
    #include <OpenGL/gl.h>
    #include <GLUT/glut.h>
    #endif
    #include <AR/gsub.h>
    #include <AR/video.h>
    #include <AR/param.h>
    #include <AR/ar.h>
     
    //
    // Camera configuration.
    //
    #ifdef _WIN32
    char			*vconf = "Data\\WDM_camera_flipV.xml";
    #else
    char			*vconf = "";
    #endif
     
     
     
     
    namespace simple {
     
     
    int             xsize, ysize;
    int             thresh = 100;
    int             count = 0;
     
    char           *cparam_name    = "Data/camera_para.dat";
    ARParam         cparam;
     
    char           *patt_name      = "Data/patt.hiro";
    int             patt_id;
    double          patt_width     = 80.0;
    double          patt_center[2] = {0.0, 0.0};
    double          patt_trans[3][4];
     
    int go(int argc, char **argv);
    static void   init(void);
    static void   cleanup(void);
    static void   keyEvent( unsigned char key, int x, int y);
    static void   mainLoop(void);
    static void   draw( void );
    }
    .cpp
    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
    #include "simple.h"
     
     
    int simple::go(int argc, char **argv)
    {
    	printf("%d",patt_id);
    	glutInit(&argc, argv);
    	init();
     
        arVideoCapStart();
        argMainLoop( NULL, keyEvent, mainLoop );
    	return (0);
    }
     
    static void   simple::keyEvent( unsigned char key, int x, int y)
    {
        /* quit if the ESC key is pressed */
        if( key == 0x1b ) {
            printf("*** %f (frame/sec)\n", (double)count/arUtilTimer());
            cleanup();
            exit(0);
        }
    }
     
    /* main loop */
    static void simple::mainLoop(void)
    {
        ARUint8         *dataPtr;
        ARMarkerInfo    *marker_info;
        int             marker_num;
        int             j, k;
     
        /* grab a vide frame */
        if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) {
            arUtilSleep(2);
            return;
        }
        if( count == 0 ) arUtilTimerReset();
        count++;
     
        argDrawMode2D();
        argDispImage( dataPtr, 0,0 );
     
        /* detect the markers in the video frame */
        if( arDetectMarker(dataPtr, thresh, &marker_info, &marker_num) < 0 ) {
            cleanup();
            exit(0);
        }
     
        arVideoCapNext();
     
        /* check for object visibility */
        k = -1;
        for( j = 0; j < marker_num; j++ ) {
            if( patt_id == marker_info[j].id ) {
                if( k == -1 ) k = j;
                else if( marker_info[k].cf < marker_info[j].cf ) k = j;
            }
        }
        if( k == -1 ) {
            argSwapBuffers();
            return;
        }
     
        /* get the transformation between the marker and the real camera */
        arGetTransMat(&marker_info[k], patt_center, patt_width, patt_trans);
    	printf("%f %f\n",patt_trans[1][1],patt_trans[1][2]);
        draw();
     
        argSwapBuffers();
    }
     
    static void simple::init( void )
    {
        ARParam  wparam;
     
        /* open the video path */
        if( arVideoOpen( vconf ) < 0 ) exit(0);
        /* find the size of the window */
        if( arVideoInqSize(&xsize, &ysize) < 0 ) exit(0);
        printf("Image size (x,y) = (%d,%d)\n", xsize, ysize);
     
        /* set the initial camera parameters */
        if( arParamLoad(cparam_name, 1, &wparam) < 0 ) {
            printf("Camera parameter load error !!\n");
            exit(0);
        }
        arParamChangeSize( &wparam, xsize, ysize, &cparam );
        arInitCparam( &cparam );
        printf("*** Camera Parameter ***\n");
        arParamDisp( &cparam );
     
        if( (patt_id=arLoadPatt(patt_name)) < 0 ) {
            printf("pattern load error !!\n");
            exit(0);
        }
     
        /* open the graphics window */
        argInit( &cparam, 1.0, 0, 0, 0, 0 );
    }
     
    /* cleanup function called when program exits */
    static void simple::cleanup(void)
    {
        arVideoCapStop();
        arVideoClose();
        argCleanup();
    }
     
    static void simple::draw( void )
    {
        double    gl_para[16];
        GLfloat   mat_ambient[]     = {0.0, 0.0, 1.0, 1.0};
        GLfloat   mat_flash[]       = {0.0, 0.0, 1.0, 1.0};
        GLfloat   mat_flash_shiny[] = {50.0};
        GLfloat   light_position[]  = {100.0,-200.0,200.0,0.0};
        GLfloat   ambi[]            = {0.1, 0.1, 0.1, 0.1};
        GLfloat   lightZeroColor[]  = {0.9, 0.9, 0.9, 0.1};
     
        argDrawMode3D();
        argDraw3dCamera( 0, 0 );
        glClearDepth( 1.0 );
        glClear(GL_DEPTH_BUFFER_BIT);
        glEnable(GL_DEPTH_TEST);
        glDepthFunc(GL_LEQUAL);
     
        /* load the camera transformation matrix */
        argConvGlpara(patt_trans, gl_para);
        glMatrixMode(GL_MODELVIEW);
        glLoadMatrixd( gl_para );
     
        glEnable(GL_LIGHTING);
        glEnable(GL_LIGHT0);
        glLightfv(GL_LIGHT0, GL_POSITION, light_position);
        glLightfv(GL_LIGHT0, GL_AMBIENT, ambi);
        glLightfv(GL_LIGHT0, GL_DIFFUSE, lightZeroColor);
        glMaterialfv(GL_FRONT, GL_SPECULAR, mat_flash);
        glMaterialfv(GL_FRONT, GL_SHININESS, mat_flash_shiny);	
        glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
        glMatrixMode(GL_MODELVIEW);
        glTranslatef( 0.0, 0.0, 25.0 );
        glutSolidCube(50.0);
        glDisable( GL_LIGHTING );
     
        glDisable( GL_DEPTH_TEST );
    }

    Mais voila, j'obtiens l'erreur de compil suivante:

    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
    ------ Build started: Project: simple, Configuration: Debug Win32 ------
    Build started 13/05/2010 15:21:24.
    ClCompile:
      simpleTest.c
    c:\dev\ra\ra\simple\include\simple.h(31): error C2061: syntax error : identifier 'simple'
    c:\dev\ra\ra\simple\include\simple.h(31): error C2059: syntax error : ';'
    c:\dev\ra\ra\simple\include\simple.h(31): error C2449: found '{' at file scope (missing function header?)
    c:\dev\ra\ra\simple\include\simple.h(53): error C2059: syntax error : '}'
    c:\dev\artoolkit\examples\simple\simpletest.c(15): error C2143: syntax error : missing '{' before ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(15): error C2059: syntax error : ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(26): error C2143: syntax error : missing '{' before ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(26): error C2059: syntax error : ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(73): error C2143: syntax error : missing '{' before ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(73): error C2059: syntax error : ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(103): error C2143: syntax error : missing '{' before ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(103): error C2059: syntax error : ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(110): error C2143: syntax error : missing '{' before ':'
    c:\dev\artoolkit\examples\simple\simpletest.c(110): error C2059: syntax error : ':'
     
    Build FAILED.
     
    Time Elapsed 00:00:02.10
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    ce que je ne comprend pas du tout car j'ai suivit les tuto. Pourriez vous m'orianter sur mon erreur?
    Merci d'avance pour votre aide.

  2. #2
    Expert éminent
    Avatar de koala01
    Homme Profil pro
    aucun
    Inscrit en
    Octobre 2004
    Messages
    11 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : Belgique

    Informations professionnelles :
    Activité : aucun

    Informations forums :
    Inscription : Octobre 2004
    Messages : 11 644
    Par défaut
    Salut,

    Tu ne dois pas essayer de définir les fonctions libres à l'intérieur d'un espace de noms comme tu définis les fonctions membres de classe.

    Ce que tu dois faire, c'est recréer une portée complète pour l'espace de noms et y définir les fonctions. Cela donne, pour le fichier cpp:
    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
     
    #include "simple.h"
     
    namespace simple
    {
    int sgo(int argc, char **argv)
    {
    	printf("%d",patt_id);
    	glutInit(&argc, argv);
    	init();
     
        arVideoCapStart();
        argMainLoop( NULL, keyEvent, mainLoop );
    	return (0);
    }
     
    static void   keyEvent( unsigned char key, int x, int y)
    {
        /* quit if the ESC key is pressed */
        if( key == 0x1b ) {
            printf("*** %f (frame/sec)\n", (double)count/arUtilTimer());
            cleanup();
            exit(0);
        }
    }
     
    /* main loop */
    static void mainLoop(void)
    {
        ARUint8         *dataPtr;
        ARMarkerInfo    *marker_info;
        int             marker_num;
        int             j, k;
     
        /* grab a vide frame */
        if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) {
            arUtilSleep(2);
            return;
        }
        if( count == 0 ) arUtilTimerReset();
        count++;
     
        argDrawMode2D();
        argDispImage( dataPtr, 0,0 );
     
        /* detect the markers in the video frame */
        if( arDetectMarker(dataPtr, thresh, &marker_info, &marker_num) < 0 ) {
            cleanup();
            exit(0);
        }
     
        arVideoCapNext();
     
        /* check for object visibility */
        k = -1;
        for( j = 0; j < marker_num; j++ ) {
            if( patt_id == marker_info[j].id ) {
                if( k == -1 ) k = j;
                else if( marker_info[k].cf < marker_info[j].cf ) k = j;
            }
        }
        if( k == -1 ) {
            argSwapBuffers();
            return;
        }
     
        /* get the transformation between the marker and the real camera */
        arGetTransMat(&marker_info[k], patt_center, patt_width, patt_trans);
    	printf("%f %f\n",patt_trans[1][1],patt_trans[1][2]);
        draw();
     
        argSwapBuffers();
    }
     
    static void init( void )
    {
        ARParam  wparam;
     
        /* open the video path */
        if( arVideoOpen( vconf ) < 0 ) exit(0);
        /* find the size of the window */
        if( arVideoInqSize(&xsize, &ysize) < 0 ) exit(0);
        printf("Image size (x,y) = (%d,%d)\n", xsize, ysize);
     
        /* set the initial camera parameters */
        if( arParamLoad(cparam_name, 1, &wparam) < 0 ) {
            printf("Camera parameter load error !!\n");
            exit(0);
        }
        arParamChangeSize( &wparam, xsize, ysize, &cparam );
        arInitCparam( &cparam );
        printf("*** Camera Parameter ***\n");
        arParamDisp( &cparam );
     
        if( (patt_id=arLoadPatt(patt_name)) < 0 ) {
            printf("pattern load error !!\n");
            exit(0);
        }
     
        /* open the graphics window */
        argInit( &cparam, 1.0, 0, 0, 0, 0 );
    }
     
    /* cleanup function called when program exits */
    static void cleanup(void)
    {
        arVideoCapStop();
        arVideoClose();
        argCleanup();
    }
     
    static void simple::draw( void )
    {
        double    gl_para[16];
        GLfloat   mat_ambient[]     = {0.0, 0.0, 1.0, 1.0};
        GLfloat   mat_flash[]       = {0.0, 0.0, 1.0, 1.0};
        GLfloat   mat_flash_shiny[] = {50.0};
        GLfloat   light_position[]  = {100.0,-200.0,200.0,0.0};
        GLfloat   ambi[]            = {0.1, 0.1, 0.1, 0.1};
        GLfloat   lightZeroColor[]  = {0.9, 0.9, 0.9, 0.1};
     
        argDrawMode3D();
        argDraw3dCamera( 0, 0 );
        glClearDepth( 1.0 );
        glClear(GL_DEPTH_BUFFER_BIT);
        glEnable(GL_DEPTH_TEST);
        glDepthFunc(GL_LEQUAL);
     
        /* load the camera transformation matrix */
        argConvGlpara(patt_trans, gl_para);
        glMatrixMode(GL_MODELVIEW);
        glLoadMatrixd( gl_para );
     
        glEnable(GL_LIGHTING);
        glEnable(GL_LIGHT0);
        glLightfv(GL_LIGHT0, GL_POSITION, light_position);
        glLightfv(GL_LIGHT0, GL_AMBIENT, ambi);
        glLightfv(GL_LIGHT0, GL_DIFFUSE, lightZeroColor);
        glMaterialfv(GL_FRONT, GL_SPECULAR, mat_flash);
        glMaterialfv(GL_FRONT, GL_SHININESS, mat_flash_shiny);	
        glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
        glMatrixMode(GL_MODELVIEW);
        glTranslatef( 0.0, 0.0, 25.0 );
        glutSolidCube(50.0);
        glDisable( GL_LIGHTING );
     
        glDisable( GL_DEPTH_TEST );
    }
    } // namespace simple
    A méditer: La solution la plus simple est toujours la moins compliquée
    Ce qui se conçoit bien s'énonce clairement, et les mots pour le dire vous viennent aisément. Nicolas Boileau
    Compiler Gcc sous windows avec MinGW
    Coder efficacement en C++ : dans les bacs le 17 février 2014
    mon tout nouveau blog

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    51
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 51
    Par défaut
    Merci pour ta réponse,

    Cependant j'ai bien integré le code suivant

    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
    #include "simple.h"
     
    namespace simple {
    int go(int argc, char **argv)
    {
           printf("%d",patt_id);
           glutInit(&argc, argv);
           init();
     
       arVideoCapStart();
       argMainLoop( NULL, keyEvent, mainLoop );
           return (0);
    }
     
    static void   keyEvent( unsigned char key, int x, int y)
    {
       /* quit if the ESC key is pressed */
       if( key == 0x1b ) {
           printf("*** %f (frame/sec)\n", (double)count/arUtilTimer());
           cleanup();
           exit(0);
       }
    }
     
    /* main loop */
    static void mainLoop(void)
    {
       ARUint8         *dataPtr;
       ARMarkerInfo    *marker_info;
       int             marker_num;
       int             j, k;
     
       /* grab a vide frame */
       if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) {
           arUtilSleep(2);
           return;
       }
       if( count == 0 ) arUtilTimerReset();
       count++;
     
       argDrawMode2D();
       argDispImage( dataPtr, 0,0 );
     
       /* detect the markers in the video frame */
       if( arDetectMarker(dataPtr, thresh, &marker_info, &marker_num) < 0 ) {
           cleanup();
           exit(0);
       }
     
       arVideoCapNext();
     
       /* check for object visibility */
       k = -1;
       for( j = 0; j < marker_num; j++ ) {
           if( patt_id == marker_info[j].id ) {
               if( k == -1 ) k = j;
               else if( marker_info[k].cf < marker_info[j].cf ) k = j;
           }
       }
       if( k == -1 ) {
           argSwapBuffers();
           return;
       }
     
       /* get the transformation between the marker and the real camera */
       arGetTransMat(&marker_info[k], patt_center, patt_width, patt_trans);
           printf("%f %f\n",patt_trans[1][1],patt_trans[1][2]);
       draw();
     
       argSwapBuffers();
    }
     
    static void init( void )
    {
       ARParam  wparam;
     
       /* open the video path */
       if( arVideoOpen( vconf ) < 0 ) exit(0);
       /* find the size of the window */
       if( arVideoInqSize(&xsize, &ysize) < 0 ) exit(0);
       printf("Image size (x,y) = (%d,%d)\n", xsize, ysize);
     
       /* set the initial camera parameters */
       if( arParamLoad(cparam_name, 1, &wparam) < 0 ) {
           printf("Camera parameter load error !!\n");
           exit(0);
       }
       arParamChangeSize( &wparam, xsize, ysize, &cparam );
       arInitCparam( &cparam );
       printf("*** Camera Parameter ***\n");
       arParamDisp( &cparam );
     
       if( (patt_id=arLoadPatt(patt_name)) < 0 ) {
           printf("pattern load error !!\n");
           exit(0);
       }
     
       /* open the graphics window */
       argInit( &cparam, 1.0, 0, 0, 0, 0 );
    }
     
    /* cleanup function called when program exits */
    static void cleanup(void)
    {
       arVideoCapStop();
       arVideoClose();
       argCleanup();
    }
     
    static void draw( void )
    {
       double    gl_para[16];
       GLfloat   mat_ambient[]     = {0.0, 0.0, 1.0, 1.0};
       GLfloat   mat_flash[]       = {0.0, 0.0, 1.0, 1.0};
       GLfloat   mat_flash_shiny[] = {50.0};
       GLfloat   light_position[]  = {100.0,-200.0,200.0,0.0};
       GLfloat   ambi[]            = {0.1, 0.1, 0.1, 0.1};
       GLfloat   lightZeroColor[]  = {0.9, 0.9, 0.9, 0.1};
     
       argDrawMode3D();
       argDraw3dCamera( 0, 0 );
       glClearDepth( 1.0 );
       glClear(GL_DEPTH_BUFFER_BIT);
       glEnable(GL_DEPTH_TEST);
       glDepthFunc(GL_LEQUAL);
     
       /* load the camera transformation matrix */
       argConvGlpara(patt_trans, gl_para);
       glMatrixMode(GL_MODELVIEW);
       glLoadMatrixd( gl_para );
     
       glEnable(GL_LIGHTING);
       glEnable(GL_LIGHT0);
       glLightfv(GL_LIGHT0, GL_POSITION, light_position);
       glLightfv(GL_LIGHT0, GL_AMBIENT, ambi);
       glLightfv(GL_LIGHT0, GL_DIFFUSE, lightZeroColor);
       glMaterialfv(GL_FRONT, GL_SPECULAR, mat_flash);
       glMaterialfv(GL_FRONT, GL_SHININESS, mat_flash_shiny);
       glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
       glMatrixMode(GL_MODELVIEW);
       glTranslatef( 0.0, 0.0, 25.0 );
       glutSolidCube(50.0);
       glDisable( GL_LIGHTING );
     
       glDisable( GL_DEPTH_TEST );
    }
    }
    et j'ai toujours l'erreur de compile:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
      simpleTest.c
    c:\dev\artoolkit\examples\simple\simpletest.c(3): error C2061: syntax error : identifier 'simple'
    c:\dev\artoolkit\examples\simple\simpletest.c(3): error C2059: syntax error : ';'
    c:\dev\artoolkit\examples\simple\simpletest.c(3): error C2449: found '{' at file scope (missing function header?)
    c:\dev\artoolkit\examples\simple\simpletest.c(147): error C2059: syntax error : '}'
    J'ai du mal à comprendre là ou ca cloche

    Merci de votre aide,

  4. #4
    Modérateur
    Avatar de bruno_pages
    Homme Profil pro
    ingénieur informaticien à la retraite
    Inscrit en
    Juin 2005
    Messages
    3 545
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 65
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : ingénieur informaticien à la retraite
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2005
    Messages : 3 545
    Par défaut
    Bonjour,

    juste au cas ou, l'extension utilisée est c et non par exemple cpp, je ne sais pas avec quoi vous compilez mais peut être que le compilateur lancé est un compilateur C et non C++ ?
    Bruno Pagès, auteur de Bouml (freeware), mes tutoriels sur DVP (vieux, non à jour )

    N'oubliez pas de consulter les FAQ UML et les cours et tutoriels UML

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    51
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 51
    Par défaut
    Autant pour moi, j'étais persuader que mon extension était en .cpp :s...
    En .cpp ca marche très bien.
    Par contre j'étais certain qu'un compilateur C++ ne différenciait pas les .c et .cpp....

    Un grand merci pour vos réponse!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XSLT]Problème de namespace sur un export XMi (UML 2.1/XMi 2.1)
    Par CocoRambo dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 25/06/2007, 09h50
  2. problème de namespace
    Par deubelte dans le forum C++
    Réponses: 10
    Dernier message: 30/05/2007, 12h48
  3. [C#/.NET 2.0] Problème de namespace/référence
    Par Tetram165 dans le forum Services Web
    Réponses: 2
    Dernier message: 05/01/2007, 01h55
  4. [XSD] Problème de namespace
    Par pierrelm dans le forum Valider
    Réponses: 3
    Dernier message: 14/09/2006, 01h19
  5. [DOM] Problème de namespace
    Par dauggui dans le forum Format d'échange (XML, JSON...)
    Réponses: 1
    Dernier message: 26/04/2006, 07h22

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