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. #21
    Membre chevronné
    Avatar de Foobar1329
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    283
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Finistère (Bretagne)

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

    Citation Envoyé par debutant-1
    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
    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
    Le gentil compilateur te dit dans low.c que :
    Avec 'sense[i].distance', sense[i] n'est pas une structure ou une union,
    Avec 'GetSensation(sense);' sens n'a pas le type attendu par GetSensation().
    Quel est donc le type de sense ?
    Avec 'GetOdometry(odometry);', même chose.
    Quel est donc le type de odometry ?

    Pour les erreurs concernant ReadLog(), même chose, les arguments n'ont pas le type attendu.

    Quand le gentil compilateur te dit 'something makes pointer from integer [...]', c'est que tu essaies de convertir un entier en un type pointeur sur quelquechose (exple : utilisation de la fonction C malloc() sans avoir inclus stdlib.h).

    Sinon, quand je vois ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    for (i = 0; i < max; i++) {
    sense[i].distance = atof(strtok(NULL, " "))*MAP_SCALE; // ligne 882
    }
    je transpire à grosses gouttes.

    A+

  2. #22
    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
    c bon j`ai reussi tt seul a suprimer qcq eurrreur 1
    mais il me fait maintenant
    undefined reference to `cos'
    undefined reference to `sin'
    ...........
    et pourtant il y a la biblio #include <math.h>
    je ne sais pas pourquoi !

    /dpslam0.1/highMap.c:551: undefined reference to `exp'
    highMap.o(.text+0x1cf4): In function `HighLineTrace':
    /dpslam0.1/highMap.c:752: undefined reference to `cos'
    highMap.o(.text+0x1d17):/dpslam0.1/highMap.c:753: undefined reference to `sin'
    highMap.o(.text+0x1eb8):/dpslam0.1/highMap.c:788: undefined reference to `tan'
    highMap.o(.text+0x2470):/dpslam0.1/highMap.c:853: undefined reference to `tan'
    highMap.o(.text+0x2979):/dpslam0.1/highMap.c:551: undefined reference to `exp'
    highMap.o(.text+0x29a3)://dpslam0.1/highMap.c:551: undefined reference to `exp'
    highMap.o(.text+0x2a1d):/dpslam0.1/highMap.c:828: undefined reference to `exp'

  3. #23
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 69
    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
    c bon j`ai reussi tt seul a suprimer qcq eurrreur 1
    mais il me fait maintenant

    ...........
    et pourtant il y a la biblio #include <math.h>
    je ne sais pas pourquoi !
    C'est quoi une biblio ? Si tu parles d'une bibliothèque, rien à voir avec <math.h> qui est uin fichier d'entête.

    Par contre, il est possible que sur ton implémentation, la bibliothèque mathématique (par exemple libm.a) soit séparée de la bibliothèque standard. Dans ce cas, il manque (par exemple) -lm quelque part sur la ligne de commande de l'éditeur de lien pour ajouter cette bibliothèque à ton projet ...

  4. #24
    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
    c bon ca marcher ton truc mais il m`a generer d`autre truc
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c mt-rand.c
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c ThisRobot.c
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c basic.c
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c map.c
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c lowMap.c
    lowMap.c: In function 'LowBuildObservation':
    lowMap.c:354: attention : 'flag' may be used uninitialized in this function
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c low.c
    low.c: In function 'InitLowSlam':
    low.c:1042: attention : passing argument 1 of 'GetSensation' 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 3 of 'ReadLog' makes pointer from integer without a cast
    low.c:1054: attention : passing argument 3 of 'ReadLog' makes pointer from integer without a cast
    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:1221: attention : passing argument 1 of 'GetSensation' from incompatible pointer type
    low.c: In function 'InitLowSlam':
    low.c:1049: attention : 'j' is used uninitialized in this function
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c highMap.c
    highMap.c: In function 'HighBuildObservation':
    highMap.c:309: attention : 'flag' may be used uninitialized in this function
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c high.c
    high.c: In function 'HighLocalize':
    high.c:78: attention : unused variable 'a'
    high.c:79: attention : 'best' may be used uninitialized in this function
    high.c:79: attention : 'keepers' may be used uninitialized in this function
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c slam.c
    slam.c: In function 'Slam':
    slam.c:129: attention : passing argument 1 of 'LowSlam' makes pointer from integer without a cast

    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -lm -o slam mt-rand.o ThisRobot.o basic.o map.o lowMap.o low.o highMap.o high.o slam.o -lpthread

    basic.o(.text+0x0): In function `InitializeThisRobot':
    /dpslam0.1/ThisRobot.c:37: définitions multiples de « InitializeThisRobot »
    ThisRobot.o(.text+0x0):/dpslam0.1/ThisRobot.c:37: défini pour la première fois ici
    basic.o(.text+0x8): In function `ConnectOdometry':
    /dpslam0.1/ThisRobot.c:41: définitions multiples de « ConnectOdometry »
    ThisRobot.o(.text+0x8):/dpslam0.1/ThisRobot.c:41: défini pour la première fois ici
    basic.o(.text+0x10): In function `ConnectLaser':
    /dpslam0.1/ThisRobot.c:45: définitions multiples de « ConnectLaser »
    ThisRobot.o(.text+0x10):/dpslam0.1/ThisRobot.c:45: défini pour la première fois ici

    /dpslam0.1/ThisRobot.c:65: définitions multiples de « Drive »
    ThisRobot.o(.text+0x30):/dpslam0.1/ThisRobot.c:65: défini pour la première fois ici
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [slam] Erreur 1

  5. #25
    Membre éprouvé

    Inscrit en
    Juin 2004
    Messages
    1 397
    Détails du profil
    Informations forums :
    Inscription : Juin 2004
    Messages : 1 397
    Par défaut
    Euh, j'ai survolé, mais ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c mt-rand.c
    Ca ne doit pas trop trop aller, si ??

  6. #26
    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 progfou
    Euh, j'ai survolé, mais ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    gcc -g -I. -O3 -Wall -I/usr/local/lib/g++-include -c mt-rand.c
    Ca ne doit pas trop trop aller, si ??
    j`ai pas compris !! il y a du g++ je sais mais je ne sais pas si ca cause de pb ou pas

  7. #27
    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
    salut
    c bon j`ai pu tt regler tt seul ! j`ai compiler en gccc et j`ai executer le programme !
    mais en voulans le compiler avec un autre compilaeur de simpelscaler a base de gcc
    il me fait l`erreur suivante :
    slam.c:27: pthread.h: No such file or directory
    avec pthread.h un des ficher d`entete !
    #include <pthread.h>
    ca veux dire quoi ?? et pourtant si j`enleve la ligne il ne reoconnais plus plusieur fonction 1 donc il est entrain de lire de pthread.h

Discussions similaires

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

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