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

C Discussion :

changer c++ en c ?


Sujet :

C

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut changer c++ en c ?
    Bonjour,
    je voudrais changer un projet qui contient de fichier c et fichier c++ en un projet qui ne contien que des fichier C
    dans les fichier C++ il n'ya pas de chose particuliere en c++ elle peuvent etre C ! ce que j'ai fait je les ai changer en ".C" au lieu de ".cpp" et dans le fichier Makefile :
    CC = g++
    #CFLAGS = -g -I. -I/usr/local/gcc280/lib/g++-include
    CFLAGS = -g -I. -O3 -Wall -I/usr/local/lib/g++-include
    ......
    j'ai changer g++ en gcc !
    je ne sais pas le reste comment je fait
    je ne sais pas aussi quoi changer dans les fichier include pour que ca marche avec gcc (les fichiees ".cpp" contiennent des #include <machin> !! est ce qu'elle reste valide en changant le nom du fichier en "".C"" et en le compilant avec gcc?? ou je doit les remplacer par d'autre biblio equivalent ?
    merci pour votre aide !

  2. #2
    Membre extrêmement actif

    Homme Profil pro
    Ingénieur R&D
    Inscrit en
    Juin 2003
    Messages
    4 506
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2003
    Messages : 4 506
    Par défaut
    Il faut les modifer.

    #include<cstdlib> devrait être remplacé par #include<stdlib.h>

    M'enfin si a l'époque il utilisait un compilateur c++ doit avoir une raison non ?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    je ne sais pas
    d'ailleur le programe principale .cpp
    il contient que des truc en c en plus les include sont celle du c et non pas c++
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <sys/wait.h>
    #include <math.h>
    #include <strings.h>
    #include <string.h>
    #include <pthread.h>
    #include <stdio.h>
    #include <stdlib.h>

    #include "high.h"
    #include "mt-rand.h"
    en tout cas lorsque le compilateur est g++ c marche tres bien mais lorsque je le change en gcc
    il me dit qu'il ya erreur dans des fichier "".h"" erreur de syntax avavnt ""&""

    or j'ai rien changer dans le fichier ".h" et plus precisement la ligne d'erreur
    :
    void GetSensation(TSense &sense);
    void GetOdometry(TOdo &odometry);

  4. #4
    Membre extrêmement actif

    Homme Profil pro
    Ingénieur R&D
    Inscrit en
    Juin 2003
    Messages
    4 506
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2003
    Messages : 4 506
    Par défaut
    Il s'agit d'un passage de paramètre par référence ( alias). En C on utilise plûtot des pointeurs donc ca donne une étoile(*) a la place du &. Cependant ca va nécessitait modification de code puisque passage par pointeur si il s'agit d'une structure il faudrait faire param->membre tandis que par référence param.membre.

  5. #5
    Rédacteur

    Avatar de gege2061
    Femme Profil pro
    Administrateur de base de données
    Inscrit en
    Juin 2004
    Messages
    5 840
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 42
    Localisation : France

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Juin 2004
    Messages : 5 840
    Par défaut
    Citation Envoyé par hegros
    En C on utilise plûtot des pointeurs
    C'est surtout qu'on a pas le choix, les références n'existent pas en C.

  6. #6
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par debutant-1
    je voudrais changer un projet qui contient de fichier c et fichier c++ en un projet qui ne contien que des fichier C
    Montre le code, c'est peut être possible.

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    Citation Envoyé par hegros
    Il s'agit d'un passage de paramètre par référence ( alias). En C on utilise plûtot des pointeurs donc ca donne une étoile(*) a la place du &. Cependant ca va nécessitait modification de code puisque passage par pointeur si il s'agit d'une structure il faudrait faire param->membre tandis que par référence param.membre.
    c possible !enfaite il me dit syntax error before'&' token donc l'erreur est avant je pense non ?

  8. #8
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    voici le fichier ".h " qui contien l'erreur ! apres compilation gcc !
    #include "basic.h"

    // The number of sensor readings for this robot (typically 181 for a laser range finder)
    #define SENSE_NUMBER 181
    // Turn radius of the robot in map squares.Since the "robot" is actually the sensor origin for the
    // purposes of this program, the turn radius is the displacement of the sensor from the robot's center
    // of rotation (assuming holonomic turns)
    #define TURN_RADIUS (0.40 * MAP_SCALE)

    // Each sensor reading has direction it is looking (theta) and a distance at which it senses the object.
    // Direction of the sensor is relative to the facing of the robot, with "forward" being 0, and is
    // measured in radians.
    struct TSense_struct{
    double theta, distance;
    };
    typedef struct TSense_struct TSenseSample;
    typedef TSenseSample TSense[SENSE_NUMBER+1];

    // This is the structure for storing odometry data from the robot. The same conditions apply as above.
    struct odo_struct{
    double x, y, theta;
    };
    typedef struct odo_struct TOdo;

    extern TOdo odometry;

    // These should be self explainatory. Each one represents how the robot actually performs these tasks,
    // which the program issues the commands. Actual implementation in ThisRobot.c is specific to each robot.
    // For purposes of playback from logfiles, these need to be present, but do not need to be implemented
    int InitializeThisRobot(int argc, char *argv[]);
    int ConnectOdometry(int argc, char *argv[]);
    int ConnectLaser(int argc, char *argv[]);
    int ConnectDrive(int argc, char *argv[]);
    void GetSensation(TSense &sense);
    void GetOdometry(TOdo &odometry);
    void Drive(double speed, double turn);

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    et il y en a exactement trois fichier "cpp" dans le projet je vous le met ici si qcq peut m'aider sa serais tres gentille !

    le programme pricipale : il marche en g++ mais en gcc je ne sais pas ce qu'il faut chager :

    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <sys/wait.h>
    #include <math.h>
    #include <strings.h>
    #include <string.h>
    #include <pthread.h>
    #include <stdio.h>
    #include <stdlib.h>

    #include "high.h"
    #include "mt-rand.h"

    // The initial seed used for the random number generated can be set here.
    #define SEED 1

    // Default names for printing map files.
    // File types are automatically appended.
    #define MAP_PATH_NAME "map"
    #define PARTICLES_PATH_NAME "particles"


    //
    // Globals
    //

    // The number of iterations between writing out the map for video. 0 is off.
    int VIDEO = 10;

    // The current commands being given to the robot for movement.
    // Not used when the robot is reading data from a log file.
    double RotationSpeed, TranslationSpeed;

    // The means by which the slam thread can be told to halt, either by user command or by the end of a playback file.
    int continueSlam;
    int PLAYBACK_COMPLETE = 0;


    //
    //
    // InitializeRobot
    //
    // Calls the routines in 'ThisRobot.c' to initialize the necessary hardware and software.
    // Each call has an opportunity to return a value of -1, which indicates that the initialization of that
    // part of the robot has failed. In that event, Initialize robot itself will return a general error of -1.
    //
    //
    int InitializeRobot(int argc, char *argv[]) {
    if (InitializeThisRobot(argc, argv) == -1) {
    fprintf(stderr, "Start up initialization of the robot has failed.\n");
    return -1;
    }

    fprintf(stderr, "Connect Odometry.\n");
    if (ConnectOdometry(argc, argv) == -1) {
    fprintf(stderr, "Unable to connect to the robot's odometry.\n");
    return -1;
    }

    fprintf(stderr, "Connect Laser.\n");
    if (ConnectLaser(argc, argv) == -1) {
    fprintf(stderr, "Unable to connect to the robot's laser.\n");
    return -1;
    }

    fprintf(stderr, "Connect Drive.\n");
    if (ConnectDrive(argc, argv) == -1) {
    fprintf(stderr, "Unable to connect to the robot's drive motors.\n");
    return -1;
    }

    return 0;
    }


    //
    // WriteLog
    //
    // Prints to file the data that we would normally be getting from sensors, such as the laser and the odometry.
    // This allows us to later play back the exact run, with different parameters.
    // All readings are in meters or radians.
    //
    void WriteLog(FILE *logFile, TSense sense)
    {
    int i;

    fprintf(logFile, "Odometry %.6f %.6f %.6f \n", odometry.x, odometry.y, odometry.theta);
    fprintf(logFile, "Laser %d ", SENSE_NUMBER);
    for (i = 0; i < SENSE_NUMBER; i++)
    fprintf(logFile, "%.6f ", sense[i].distance/MAP_SCALE);
    fprintf(logFile, "\n");
    }



    //
    // This calls the procedures in the other files which do all the real work.
    // If you wanted to not use hierarchical SLAM, you could remove all references here to High*, and make
    // certain to set LOW_DURATION in low.h to some incredibly high number.
    //
    void *Slam(void *a)
    {
    TPath *path, *trashPath;
    TSenseLog *obs, *trashObs;

    InitHighSlam();
    InitLowSlam();

    while (continueSlam) {
    LowSlam(continueSlam, &path, &obs);
    HighSlam(path, obs);

    // Get rid of the path and log of observations
    while (path != NULL) {
    trashPath = path;
    path = path->next;
    free(trashPath);
    }
    while (obs != NULL) {
    trashObs = obs;
    obs = obs->next;
    free(trashObs);
    }
    }

    CloseLowSlam();
    return NULL;
    }
    int main (int argc, char *argv[])
    {
    //char command[256], tempString[20];
    int x;
    //int y;
    //double maxDist, tempDist, tempAngle;
    int WANDER, EXPLORE, DIRECT_COMMAND;
    pthread_t slam_thread;

    RECORDING = "";
    PLAYBACK = "";
    for (x = 1; x < argc; x++) {
    if (!strncmp(argv[x], "-R", 2))
    RECORDING = "current.log";
    if (!strncmp(argv[x], "-r", 2)) {
    x++;
    RECORDING = argv[x];
    }
    else if (!strncmp(argv[x], "-p", 2)) {
    x++;
    PLAYBACK = argv[x];
    }
    else if (!strncmp(argv[x], "-P", 2))
    PLAYBACK = "current.log";
    }

    fprintf(stderr, "********** Localization Example *************\n");
    if (PLAYBACK == "")
    if (InitializeRobot(argc, argv) == -1)
    return -1;

    fprintf(stderr, "********** World Initialization ***********\n");

    seedMT(SEED);
    // Spawn off a seperate thread to do SLAM
    //
    // Should use semaphores or similar to prevent reading of the map
    // during updates to the map.
    //
    continueSlam = 1;
    pthread_create(&slam_thread, (pthread_attr_t *) NULL, Slam, &x);

    fprintf(stderr, "*********** Main Loop (Movement) **********\n");


    // This is the spot where code should be inserted to control the robot. You can go ahead and assume
    // that the robot is localizing and mapping.
    WANDER = 0;
    EXPLORE = 0;
    DIRECT_COMMAND = 0;
    RotationSpeed = 0.0;
    TranslationSpeed = 0.0;
    pthread_join(slam_thread, NULL);
    return 0;
    }

  10. #10
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par debutant-1
    voici le fichier ".h " qui contien l'erreur ! apres compilation gcc !
    A modifier :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    void GetSensation(TSense *sense);
    void GetOdometry(TOdo *odometry);
    Evidemment, le code correspondant doit être modifié...

  11. #11
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    le deuxiemme fichier cpp est
    basic.cpp
    // These includes pull in interface definitions and utilities.
    #include "ThisRobot.cpp"


    // Set the maximum usuable distance for the laser range finder. This number is often less than the actual
    // reliable distance for the specific LRF, because the laser casts 'scatter' at long distances.
    #define MAX_SENSE_RANGE 7.95 * MAP_SCALE

    // Some useful macros
    #define SIGN(A) ((A) >= 0.0 ? (1.0) : (-1.0))
    #define SQUARE(A) (((A) * (A)))
    #define MAX(A,B) ((A) >= (B) ? (A) : (B))
    #define MIN(A,B) ((A) >= (B) ? (B) : (A))
    et le dernier en cpp est:
    ThisRobot.cpp
    #include "ThisRobot.h"


    TOdo odometry;


    int InitializeThisRobot(int argc, char *argv[]) {
    return 0;
    }

    int ConnectOdometry(int argc, char *argv[]) {
    return 0;
    }

    int ConnectLaser(int argc, char *argv[]) {
    return 0;
    }

    int ConnectDrive(int argc, char *argv[]) {
    return 0;
    }

    // This is never going to be called if we are truly running this offline. If for some reason this is run
    // not in playback mode, this function wont do anything.
    void GetSensation(TSense &sense) {
    return;
    }


    void GetOdometry(TOdo &odometry) {
    return;
    }


    void Drive(double speed, double turn) {
    return;
    }
    voila mes trois fichier cpp j'espert que vous allez m'aider à les modifier pour quelle se compile en gcc
    il faut aussi que je change le fichier Makfile:
    CC = g++
    #CFLAGS = -g -I. -I/usr/local/gcc280/lib/g++-include
    CFLAGS = -g -I. -O3 -Wall -I/usr/local/lib/g++-include
    # For profiling the code :
    #CFLAGS += -pg

    #LDFLAGS = -lnsl -lnls -lsocket
    LDFLAGS = -lpthread
    ........

  12. #12
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    Citation Envoyé par Emmanuel Delahaye
    A modifier :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    void GetSensation(TSense *sense);
    void GetOdometry(TOdo *odometry);
    Evidemment, le code correspondant doit être modifié...
    ca marche la premiere erreur a disparu ! les gars vous ete des pro !!!
    il me reste que deux petite erreur :

    il me dit 2 erreur dans un map.h
    au niveaux de ces ligne :
    typedef struct TAncestor_struct TAncestor;
    typedef struct TAncestor_struct *PAncestor;

    struct TParticle_struct {
    float x, y, theta;
    float C, D, T;
    double probability;

    TAncestor_struct *ancestryNode; // ligne 196
    };
    il me dit
    map.h:196: erreur: syntax error before 'TAncestor_struct ' // cad la derniere ligne dans le petit bout que je vous ai mit
    et il me dit aussi
    dans la meme ligne : attention : pas de point virgule à la fin de la structure ou de l'union
    donc c une seul erreur et un warning !
    ca serais genial de la résoudre !

  13. #13
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par debutant-1
    basic.cpp
    A renommer en basic.c
    et le dernier en cpp est:
    ThisRobot.cpp
    A renommer en ThisRobot.c
    A modifier :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    void GetSensation(TSense *sense) {
    return;
    }
     
    void GetOdometry(TOdo *odometry) {
    return;
    }
    Makefile :

  14. #14
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    tout est dans l'ordre chef !
    il me rest que le truc que je vous ai dit un peut plus haut :
    map.h:196: erreur: syntax error before 'TAncestor_struct '

  15. #15
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par debutant-1
    tout est dans l'ordre chef !
    il me rest que le truc que je vous ai dit un peut plus haut :
    map.h:196: erreur: syntax error before 'TAncestor_struct '
    Comme ça, je ne vois pas. C'est peut être ailleurs... Il faudrait tout le code modifié... (Ou au moins une version réduite mais complète qui montre le problème).

  16. #16
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 395
    Par défaut
    remplace TAncestor_struct par "TAncestor" ou par "struct TAncestor_struct" dans les lignes litigieuses.
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  17. #17
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    je pense que ca marcher ton truc ! il ne me fait plus d'erreur et il est passer a compiler le fichier suivant !
    puisque dans le fichier Makefile il doit avoire tt ces fichier :
    SRC = mt-rand.o ThisRobot.o basic.o map.o lowMap.o low.o highMap.o high.o slam.o
    maintenant il est passer a low.o cad il a fait 5 et il reste 4
    mais ca avance à chaque foi on regle une chose grace a vous !
    dans le nouveaux fichier il m'a fait une erreure dans low.h comme la precedente celle de sytax erreur avant le "&" je l'ai remplacer par "*" et a disparut l'erreur !je suis un bon éleve lol
    il me reste les erreur dans low.c
    comme premiere erreur il me dit
    syntax error before 'holde' cad dire la derniere ligne du extrait en dessou:
    ....
    int curGeneration;
    TSense sense;
    unsigned char map[MAP_WIDTH][MAP_HEIGHT];
    Hold hold[LOW_DURATION];
    enfaite tout le projet ce trouve ici

  18. #18
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    excusez moi je me suis tremper dans le petit bou de code le revoila
    struct THold {
    TSense sense;
    double C, D, T;
    };


    int curGeneration;
    TSense sense;
    unsigned char map[MAP_WIDTH][MAP_HEIGHT];
    THold hold[LOW_DURATION];
    c juste un ensemble de declaration il manquet le t a "Hold"
    il me fait erreur befor hold

  19. #19
    Membre chevronné
    Avatar de Foobar1329
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    283
    Détails du profil
    Informations personnelles :
    Âge : 44
    Localisation : France, Finistère (Bretagne)

    Informations forums :
    Inscription : Juin 2006
    Messages : 283
    Par défaut
    Hello,

    Citation Envoyé par debutant-1
    excusez moi je me suis tremper dans le petit bou de code le revoila

    c juste un ensemble de declaration il manquet le t a "Hold"
    il me fait erreur befor hold
    Il s'agit d'une des grandes différences entre C et C++,

    En C, il faut définir un alias de type avec un typedef pour pouvoir utiliser une structure sans spécifier le mot-clé struct :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    typedef struct THold {
    TSense sense;
    double C, D, T;
    } THold;
    En C++, pas besoin du typedef, un structure est une fabrique d'objets au même titre qu'une classe (il n'y a que la portée par défaut (sans mot clé de portée public, private, ou protected) des membres qui changent, public avec struct, private avec class.).

    A+

  20. #20
    Membre averti
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    65
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 65
    Par défaut
    impecable l`erreur a disparu !!!!
    il me reste les erreur suivante :
    low.c: In function 'ReadLog':
    low.c:854: erreur: request for member 'distance' in something not a structure or union
    low.c:855: erreur: request for member 'distance' in something not a structure or union
    low.c:856: erreur: request for member 'distance' in something not a structure or union
    low.c:882: erreur: request for member 'distance' in something not a structure or union
    low.c: In function 'InitLowSlam':
    low.c:1042: attention : passing argument 1 of 'GetSensation' from incompatible pointer type
    low.c:1043: erreur: incompatible type for argument 1 of 'GetOdometry'
    low.c:1049: attention : passing argument 2 of 'ReadLog' from incompatible pointer type
    low.c:1049: attention : passing argument 3 of 'ReadLog' makes pointer from integer without a cast
    low.c:1050: attention : passing argument 2 of 'ReadLog' from incompatible pointer type
    low.c:1050: attention : passing argument 3 of 'ReadLog' makes pointer from integer without a cast
    low.c:1054: attention : passing argument 2 of 'ReadLog' from incompatible pointer type
    low.c:1054: attention : passing argument 3 of 'ReadLog' makes pointer from integer without a cast
    low.c:1055: attention : passing argument 2 of 'ReadLog' from incompatible pointer type
    low.c:1055: attention : passing argument 3 of 'ReadLog' makes pointer from integer without a cast
    low.c: In function 'LowSlam':
    low.c:1187: attention : assignment makes pointer from integer without a cast
    low.c:1193: erreur: incompatible type for argument 1 of 'GetOdometry'
    low.c:1205: attention : passing argument 2 of 'ReadLog' from incompatible pointer type
    low.c:1205: attention : passing argument 2 of 'ReadLog' from incompatible pointer type
    low.c:1221: attention : passing argument 1 of 'GetSensation' from incompatible pointer type
    make: *** [low.o] Erreur 1
    voici la boucle dans laquel se trouve les 3 premiere erreurs :
    for (i = 0; i < max; i++) {
    sense[i].distance = atof(strtok(NULL, " "))*MAP_SCALE/100.0; //ligne 854
    if (sense[i].distance > MAX_SENSE_RANGE) //ligne 855
    sense[i].distance = MAX_SENSE_RANGE; //ligne 856
    }
    l`autre ereur du meme type :
    for (i = 0; i < max; i++) {
    sense[i].distance = atof(strtok(NULL, " "))*MAP_SCALE; // ligne 882
    }
    les autre ligne :
    if (PLAYBACK == "") {
    // Grab our initial reading of the odometer and laser
    GetSensation(sense); // ligne1042
    GetOdometry(odometry); // ligne1043
    }
    le dernier :
    if (PLAYBACK == "") {
    GetOdometry(odometry); /// 1193

Discussions similaires

  1. Changer l'image d'une texture
    Par alltech dans le forum DirectX
    Réponses: 5
    Dernier message: 21/08/2002, 01h31
  2. TextOut : comment changer de font
    Par Freakazoid dans le forum DirectX
    Réponses: 2
    Dernier message: 15/07/2002, 20h46
  3. Réponses: 2
    Dernier message: 26/06/2002, 13h16
  4. changer de repertoire et situer
    Par chateau dans le forum C
    Réponses: 4
    Dernier message: 24/06/2002, 11h27
  5. changer l'adresse d'un fichier...
    Par cava dans le forum C
    Réponses: 6
    Dernier message: 05/06/2002, 12h22

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