Problème de compilation
Fermé
Littlenico
Messages postés
68
Date d'inscription
samedi 11 février 2006
Statut
Membre
Dernière intervention
5 mars 2009
-
11 févr. 2006 à 10:41
Littlenico Messages postés 68 Date d'inscription samedi 11 février 2006 Statut Membre Dernière intervention 5 mars 2009 - 13 févr. 2006 à 18:34
Littlenico Messages postés 68 Date d'inscription samedi 11 février 2006 Statut Membre Dernière intervention 5 mars 2009 - 13 févr. 2006 à 18:34
A voir également:
- Problème de compilation
- Compilation pdf - Guide
- Breach compilation - Guide
- Erreur de compilation dans le module caché thisworkbook ✓ - Forum Excel
- Erreur de compilation end sub attendu - Forum Access
- One piece compilation episode ✓ - Forum Cinéma / Télé
3 réponses
lami20j
Messages postés
21331
Date d'inscription
jeudi 4 novembre 2004
Statut
Modérateur, Contributeur sécurité
Dernière intervention
30 octobre 2019
3 567
11 févr. 2006 à 11:30
11 févr. 2006 à 11:30
no newline at end of file
pas de nouvelle ligne à la fin de fichier
Que dois je faire ?
Affiche ton code s'il n'est pas confidentiel.
pas de nouvelle ligne à la fin de fichier
Que dois je faire ?
Affiche ton code s'il n'est pas confidentiel.
Littlenico
Messages postés
68
Date d'inscription
samedi 11 février 2006
Statut
Membre
Dernière intervention
5 mars 2009
2
11 févr. 2006 à 14:17
11 févr. 2006 à 14:17
POUR ENTREESORTIE :
partie spécification :
#ifndef _ENTREE_SORTIE_H
#define _ENTREE_SORTIE_H
#include "chaine.h"
//------------------------------------------------------------------------------
// SPECIFICATION DES SOUS-PROGRAMMES DE LECTURE SUR L'ENTREE STANDARD
// CHAQUE LECTURE DOIT ETRE VALIDEE PAR L'APPUI SUR LA TOUCHE <ENTREE>
//------------------------------------------------------------------------------
// attend l'appui sur la touche <ENTREE>
void lire () ;
// lit un booleen v
// si la valeur lue est 1, le booleen v prend la valeur true
// si la valeur lue est 0, le booleen v prend la valeur false
// leve l'exception "LECTURE BOOLEEN INCORRECTE" si la saisie est incorrecte
void lire (bool & v) throw (Chaine) ;
// lit un caractere v
// leve l'exception "LECTURE CARACTERE INCORRECTE" si la saisie est incorrecte
void lire (char & v) throw (Chaine) ;
// lit un entier court v
// leve l'exception "LECTURE ENTIER COURT INCORRECTE" si la saisie est
// incorrecte
void lire (short & v) throw (Chaine) ;
// lit un entier court non signe v
// leve l'exception "LECTURE ENTIER COURT NON SIGNE INCORRECTE" si la saisie
// est incorrecte
void lire (unsigned short & v) throw (Chaine) ;
// lit un entier v
// leve l'exception "LECTURE ENTIER INCORRECTE" si la saisie est incorrecte
void lire (int & v) throw (Chaine) ;
// lit un entier non signe
// leve l'exception "LECTURE ENTIER NON SIGNE INCORRECTE" si la saisie est
// incorrecte
void lire (unsigned int & v) throw (Chaine) ;
// lit un entier long v
// leve l'exception "LECTURE ENTIER LONG INCORRECTE" si la saisie est incorrecte
void lire (long & v) throw (Chaine) ;
// lit un entier long non signe v
// leve l'exception "LECTURE ENTIER LONG NON SIGNE INCORRECTE" si la saisie est
// incorrecte
void lire (unsigned long & v) throw (Chaine) ;
// lit un reel v
// leve l'exception "LECTURE REEL INCORRECTE" si la saisie est incorrecte
void lire (float & v) throw (Chaine) ;
// lit un reel double precision v
// leve l'exception "LECTURE REEL DOUBLE PRECISION INCORRECTE" si la saisie est
// incorrecte
void lire (double & v) throw (Chaine) ;
// lit une chaine ch sur l'entree standard
// leve l'exception "LECTURE CHAINE INCORRECTE" si la saisie est incorrecte
void lire (Chaine & ch) throw (Chaine) ;
//------------------------------------------------------------------------------
// SPECIFICATION DES SOUS-PROGRAMMES D'ECRITURE SUR LA SORTIE STANDARD
// LES IDENTIFICATEURS DE SOUS-PROGRAMMES SE TERMINANT PAR NL POSITIONNENT
// LE CURSEUR AU DEBUT DE LA LIGNE SUIVANTE APRES AVOIR EFFECTUE L'ECRITURE
//------------------------------------------------------------------------------
// positionne le curseur en debut de ligne suivante
void ecrireNL () ;
// ecrit un booleen v
// si v a pour valeur true, la valeur affichee est egale a 1
// si v a pour valeur false, la valeur affichee est egale a 0
void ecrire (const bool v) ;
void ecrireNL (const bool v);
// ecrit un caractere v
void ecrire (const char v) ;
void ecrireNL (const char v) ;
// ecrit un entier court v
void ecrire (const short v) ;
void ecrireNL (const short v) ;
// ecrit un entier court non signe v
void ecrire (const unsigned short v) ;
void ecrireNL (const unsigned short v) ;
// ecrit un entier v
void ecrire (const int v) ;
void ecrireNL (const int v) ;
// ecrit un entier non signe v
void ecrire (const unsigned int v) ;
void ecrireNL (const unsigned int v) ;
// ecrit un entier long v
void ecrire (const long v) ;
void ecrireNL (const long v) ;
// ecrit un entier long non signe v
void ecrire (const unsigned long v) ;
void ecrireNL (const unsigned long v) ;
// ecrit un reel v avec nb chiffres apres le point decimal
void ecrire (const float v, const int nb) ;
void ecrireNL (const float v, const int nb) ;
// ecrit un reel double precision v avec nb chiffres apres le point decimal
void ecrire (const double v, const int nb) ;
void ecrireNL (const double v, const int nb) ;
// ecrit une chaine ch sur la sortie standard
void ecrire (const Chaine ch) ;
// ecrit une chaine ch sur la sortie standard suivie d'un retour a la ligne
void ecrireNL (const Chaine ch) ;
//------------------------------------------------------------------------------
// SPECIFICATION DES SOUS-PROGRAMMES DE GESTION DE L'AFFICHAGE ECRAN
//------------------------------------------------------------------------------
// remet a blanc l'ecran et positionne le curseur en haut a gauche de l'ecran
void effacer() ;
// positionne l'affichage en mode video inverse
void inverser() ;
// positionne l'affichage en mode normal
void normal () ;
// positionne l'affichage en gras
void gras () ;
// emet un beep sonore
void beep () ;
// positionne le curseur en ligne l et colonne c
void allerLC (const int l, const int c) ;
#endif
partie implémentation :
//------------------------------------------------------------------------------
// IMPORTATION DES BIBLIOTHEQUES UTILISEES
//------------------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include "entreeSortie.h"
using namespace std ;
static bool indic = false ;
//------------------------------------------------------------------------------
// SOUS-PROGRAMMES
//------------------------------------------------------------------------------
void allerLC (const int x, const int y)
{
cout <<"\033[" <<x <<";" <<y <<"H" <<flush ;
}
void effacer ()
{
cout <<"\033[H\033[J" <<flush ;
}
void inverser ()
{
cout <<"\033[7m" <<flush ;
}
void normal ()
{
cout <<"\033[0m" <<flush ;
}
void gras ()
{
cout <<"\033[1m" <<flush ;
}
void beep ()
{
cout <<"\007" <<flush ;
}
void lire ()
{
char c [255+1] ;
cout <<"\ntaper sur ENTREE pour continuer ..." <<endl ;
if (indic)
{
indic = false ;
cin.getline (c, 256, '\n') ;
}
cin.getline (c, 256, '\n') ;
}
void lire (bool & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE BOOLEEN INCORRECTE") ;
}
}
void lire (char & v) throw (Chaine)
{
if (indic)
{
cin >>ws ;
}
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE CARACTERE INCORRECTE") ;
}
}
void lire (short & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER COURT INCORRECTE") ;
}
}
void lire (unsigned short & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER COURT NON SIGNE INCORRECTE") ;
}
}
void lire (int & v) throw (Chaine)
{
cin >>v ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER INCORRECTE") ;
}
indic = true ;
}
void lire (unsigned int & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER NON SIGNE INCORRECTE") ;
}
}
void lire (long & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER LONG INCORRECTE") ;
}
}
void lire (unsigned long & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER LONG NON SIGNE INCORRECTE") ;
}
}
void lire (float & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE REEL INCORRECTE") ;
}
}
void lire (double & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE REEL DOUBLE PRECISION INCORRECTE") ;
}
}
void lire (Chaine & ch) throw (Chaine)
{
if (indic)
{
indic = false ;
cin.getline (ch.chaine, 256, '\n') ;
}
cin.getline (ch.chaine, 256, '\n') ;
if (! cin.good ())
{
throw uneChaine ("LECTURE CHAINE INCORRECTE") ;
}
}
void ecrire (const bool v)
{
cout <<v <<flush ;
}
void ecrireNL (const bool v)
{
cout <<v <<endl ;
}
void ecrire (const char v)
{
cout <<v <<flush ;
}
void ecrireNL (const char v)
{
cout <<v <<endl ;
}
void ecrire (const short v)
{
cout <<v <<flush ;
}
void ecrireNL (const short v)
{
cout <<v <<endl ;
}
void ecrire (const unsigned short v)
{
cout <<v <<flush ;
}
void ecrireNL (const unsigned short v)
{
cout <<v <<endl ;
}
void ecrire (const int v)
{
cout <<v <<flush ;
}
void ecrireNL (const int v)
{
cout <<v <<endl ;
}
void ecrire (const unsigned int v)
{
cout <<v <<flush ;
}
void ecrireNL (const unsigned int v)
{
cout <<v <<endl ;
}
void ecrire (const long v)
{
cout <<v <<flush ;
}
void ecrireNL (const long v)
{
cout <<v <<endl ;
}
void ecrire (const unsigned long v)
{
cout <<v <<flush ;
}
void ecrireNL (const unsigned long v)
{
cout <<v <<endl ;
}
void ecrire (const float v, const int nb)
{
cout.setf (ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) <<v <<flush ;
}
void ecrireNL (const float v, const int nb)
{
cout.setf (ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) <<v <<endl ;
}
void ecrire (const double v, const int nb)
{
cout.setf(ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) ;
cout <<v <<flush;
}
void ecrireNL (const double v, const int nb)
{
cout.setf(ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) ;
cout <<v <<endl ;
}
void ecrireNL ()
{
cout <<endl ;
}
void ecrire (const Chaine ch)
{
cout <<ch.chaine <<flush ;
}
void ecrireNL (const Chaine ch)
{
cout <<ch.chaine <<endl ;
}
partie spécification :
#ifndef _ENTREE_SORTIE_H
#define _ENTREE_SORTIE_H
#include "chaine.h"
//------------------------------------------------------------------------------
// SPECIFICATION DES SOUS-PROGRAMMES DE LECTURE SUR L'ENTREE STANDARD
// CHAQUE LECTURE DOIT ETRE VALIDEE PAR L'APPUI SUR LA TOUCHE <ENTREE>
//------------------------------------------------------------------------------
// attend l'appui sur la touche <ENTREE>
void lire () ;
// lit un booleen v
// si la valeur lue est 1, le booleen v prend la valeur true
// si la valeur lue est 0, le booleen v prend la valeur false
// leve l'exception "LECTURE BOOLEEN INCORRECTE" si la saisie est incorrecte
void lire (bool & v) throw (Chaine) ;
// lit un caractere v
// leve l'exception "LECTURE CARACTERE INCORRECTE" si la saisie est incorrecte
void lire (char & v) throw (Chaine) ;
// lit un entier court v
// leve l'exception "LECTURE ENTIER COURT INCORRECTE" si la saisie est
// incorrecte
void lire (short & v) throw (Chaine) ;
// lit un entier court non signe v
// leve l'exception "LECTURE ENTIER COURT NON SIGNE INCORRECTE" si la saisie
// est incorrecte
void lire (unsigned short & v) throw (Chaine) ;
// lit un entier v
// leve l'exception "LECTURE ENTIER INCORRECTE" si la saisie est incorrecte
void lire (int & v) throw (Chaine) ;
// lit un entier non signe
// leve l'exception "LECTURE ENTIER NON SIGNE INCORRECTE" si la saisie est
// incorrecte
void lire (unsigned int & v) throw (Chaine) ;
// lit un entier long v
// leve l'exception "LECTURE ENTIER LONG INCORRECTE" si la saisie est incorrecte
void lire (long & v) throw (Chaine) ;
// lit un entier long non signe v
// leve l'exception "LECTURE ENTIER LONG NON SIGNE INCORRECTE" si la saisie est
// incorrecte
void lire (unsigned long & v) throw (Chaine) ;
// lit un reel v
// leve l'exception "LECTURE REEL INCORRECTE" si la saisie est incorrecte
void lire (float & v) throw (Chaine) ;
// lit un reel double precision v
// leve l'exception "LECTURE REEL DOUBLE PRECISION INCORRECTE" si la saisie est
// incorrecte
void lire (double & v) throw (Chaine) ;
// lit une chaine ch sur l'entree standard
// leve l'exception "LECTURE CHAINE INCORRECTE" si la saisie est incorrecte
void lire (Chaine & ch) throw (Chaine) ;
//------------------------------------------------------------------------------
// SPECIFICATION DES SOUS-PROGRAMMES D'ECRITURE SUR LA SORTIE STANDARD
// LES IDENTIFICATEURS DE SOUS-PROGRAMMES SE TERMINANT PAR NL POSITIONNENT
// LE CURSEUR AU DEBUT DE LA LIGNE SUIVANTE APRES AVOIR EFFECTUE L'ECRITURE
//------------------------------------------------------------------------------
// positionne le curseur en debut de ligne suivante
void ecrireNL () ;
// ecrit un booleen v
// si v a pour valeur true, la valeur affichee est egale a 1
// si v a pour valeur false, la valeur affichee est egale a 0
void ecrire (const bool v) ;
void ecrireNL (const bool v);
// ecrit un caractere v
void ecrire (const char v) ;
void ecrireNL (const char v) ;
// ecrit un entier court v
void ecrire (const short v) ;
void ecrireNL (const short v) ;
// ecrit un entier court non signe v
void ecrire (const unsigned short v) ;
void ecrireNL (const unsigned short v) ;
// ecrit un entier v
void ecrire (const int v) ;
void ecrireNL (const int v) ;
// ecrit un entier non signe v
void ecrire (const unsigned int v) ;
void ecrireNL (const unsigned int v) ;
// ecrit un entier long v
void ecrire (const long v) ;
void ecrireNL (const long v) ;
// ecrit un entier long non signe v
void ecrire (const unsigned long v) ;
void ecrireNL (const unsigned long v) ;
// ecrit un reel v avec nb chiffres apres le point decimal
void ecrire (const float v, const int nb) ;
void ecrireNL (const float v, const int nb) ;
// ecrit un reel double precision v avec nb chiffres apres le point decimal
void ecrire (const double v, const int nb) ;
void ecrireNL (const double v, const int nb) ;
// ecrit une chaine ch sur la sortie standard
void ecrire (const Chaine ch) ;
// ecrit une chaine ch sur la sortie standard suivie d'un retour a la ligne
void ecrireNL (const Chaine ch) ;
//------------------------------------------------------------------------------
// SPECIFICATION DES SOUS-PROGRAMMES DE GESTION DE L'AFFICHAGE ECRAN
//------------------------------------------------------------------------------
// remet a blanc l'ecran et positionne le curseur en haut a gauche de l'ecran
void effacer() ;
// positionne l'affichage en mode video inverse
void inverser() ;
// positionne l'affichage en mode normal
void normal () ;
// positionne l'affichage en gras
void gras () ;
// emet un beep sonore
void beep () ;
// positionne le curseur en ligne l et colonne c
void allerLC (const int l, const int c) ;
#endif
partie implémentation :
//------------------------------------------------------------------------------
// IMPORTATION DES BIBLIOTHEQUES UTILISEES
//------------------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include "entreeSortie.h"
using namespace std ;
static bool indic = false ;
//------------------------------------------------------------------------------
// SOUS-PROGRAMMES
//------------------------------------------------------------------------------
void allerLC (const int x, const int y)
{
cout <<"\033[" <<x <<";" <<y <<"H" <<flush ;
}
void effacer ()
{
cout <<"\033[H\033[J" <<flush ;
}
void inverser ()
{
cout <<"\033[7m" <<flush ;
}
void normal ()
{
cout <<"\033[0m" <<flush ;
}
void gras ()
{
cout <<"\033[1m" <<flush ;
}
void beep ()
{
cout <<"\007" <<flush ;
}
void lire ()
{
char c [255+1] ;
cout <<"\ntaper sur ENTREE pour continuer ..." <<endl ;
if (indic)
{
indic = false ;
cin.getline (c, 256, '\n') ;
}
cin.getline (c, 256, '\n') ;
}
void lire (bool & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE BOOLEEN INCORRECTE") ;
}
}
void lire (char & v) throw (Chaine)
{
if (indic)
{
cin >>ws ;
}
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE CARACTERE INCORRECTE") ;
}
}
void lire (short & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER COURT INCORRECTE") ;
}
}
void lire (unsigned short & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER COURT NON SIGNE INCORRECTE") ;
}
}
void lire (int & v) throw (Chaine)
{
cin >>v ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER INCORRECTE") ;
}
indic = true ;
}
void lire (unsigned int & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER NON SIGNE INCORRECTE") ;
}
}
void lire (long & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER LONG INCORRECTE") ;
}
}
void lire (unsigned long & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE ENTIER LONG NON SIGNE INCORRECTE") ;
}
}
void lire (float & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE REEL INCORRECTE") ;
}
}
void lire (double & v) throw (Chaine)
{
cin >>v ;
indic = true ;
if (! cin.good ())
{
throw uneChaine ("LECTURE REEL DOUBLE PRECISION INCORRECTE") ;
}
}
void lire (Chaine & ch) throw (Chaine)
{
if (indic)
{
indic = false ;
cin.getline (ch.chaine, 256, '\n') ;
}
cin.getline (ch.chaine, 256, '\n') ;
if (! cin.good ())
{
throw uneChaine ("LECTURE CHAINE INCORRECTE") ;
}
}
void ecrire (const bool v)
{
cout <<v <<flush ;
}
void ecrireNL (const bool v)
{
cout <<v <<endl ;
}
void ecrire (const char v)
{
cout <<v <<flush ;
}
void ecrireNL (const char v)
{
cout <<v <<endl ;
}
void ecrire (const short v)
{
cout <<v <<flush ;
}
void ecrireNL (const short v)
{
cout <<v <<endl ;
}
void ecrire (const unsigned short v)
{
cout <<v <<flush ;
}
void ecrireNL (const unsigned short v)
{
cout <<v <<endl ;
}
void ecrire (const int v)
{
cout <<v <<flush ;
}
void ecrireNL (const int v)
{
cout <<v <<endl ;
}
void ecrire (const unsigned int v)
{
cout <<v <<flush ;
}
void ecrireNL (const unsigned int v)
{
cout <<v <<endl ;
}
void ecrire (const long v)
{
cout <<v <<flush ;
}
void ecrireNL (const long v)
{
cout <<v <<endl ;
}
void ecrire (const unsigned long v)
{
cout <<v <<flush ;
}
void ecrireNL (const unsigned long v)
{
cout <<v <<endl ;
}
void ecrire (const float v, const int nb)
{
cout.setf (ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) <<v <<flush ;
}
void ecrireNL (const float v, const int nb)
{
cout.setf (ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) <<v <<endl ;
}
void ecrire (const double v, const int nb)
{
cout.setf(ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) ;
cout <<v <<flush;
}
void ecrireNL (const double v, const int nb)
{
cout.setf(ios::fixed, ios::floatfield) ;
cout <<setprecision (nb) ;
cout <<v <<endl ;
}
void ecrireNL ()
{
cout <<endl ;
}
void ecrire (const Chaine ch)
{
cout <<ch.chaine <<flush ;
}
void ecrireNL (const Chaine ch)
{
cout <<ch.chaine <<endl ;
}
dedale82
Messages postés
403
Date d'inscription
jeudi 15 avril 2004
Statut
Membre
Dernière intervention
28 octobre 2008
282
11 févr. 2006 à 16:48
11 févr. 2006 à 16:48
Salut,
à mon avis, il suffit de rajouter une ligne vide à la fin de ton fichier et ça devrait suffire. Tu essayes de compiler avec Gcc ou DevC++?
A plus
à mon avis, il suffit de rajouter une ligne vide à la fin de ton fichier et ça devrait suffire. Tu essayes de compiler avec Gcc ou DevC++?
A plus
Littlenico
Messages postés
68
Date d'inscription
samedi 11 février 2006
Statut
Membre
Dernière intervention
5 mars 2009
2
12 févr. 2006 à 11:02
12 févr. 2006 à 11:02
slt dedale82.
pour l'instant j'utilise mandriva donc je compile avec la commande g++ -c
pour l'instant j'utilise mandriva donc je compile avec la commande g++ -c
11 févr. 2006 à 11:52
11 févr. 2006 à 11:54
Quel fichier?
11 févr. 2006 à 11:59
11 févr. 2006 à 12:02
En bref, fait une copier/coller de ton fichier pour voir le code ( ton programme )
11 févr. 2006 à 13:04
#include /home/nicolas/TRAVAIL/entreeSortie.h
#include /home/nicolas/TRAVAIL/chaine.h
int main ()
{
ecrire(uneChaine("bojour"));
}
et entreeSortie est la bibliothèque des procédures "lire" et "ecrire"
et chaine est la bibliothèque des cahines de charactères