Sakut a tous
j'écris un programme en C++ et j'ai l'erreur "expected unqualified id before 'namespace'" quand j'essaie de compiler. je pense avoir localisé la ligne qui pose probleme puisque qd je la commente, celle ci disparait. Néanmoins je ne sais pas quel est le probleme.
function.h
function.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 #ifndef FUNCTION_H_INCLUDED #define FUNCTION_H_INCLUDED #include <string> #include <vector> /* *Ensemble des fonctions utilisées par les différentes classes * */ std::vector <std::string> extractSbstr(std::string chaine,char charSeparateur); std::string getConfig(std::string section,std::string cle,std::string nomFichier);//LIGNE OU IL Y A L'ERREUR(du moins je crois) std::string convertIntString(int entier); int convertStringInt(std::string chaine); int mysqlconnect(std::string DB); struct tm setDate(int jour,int mois,int an,int heur,int mn,int s); int getYear(); #endif // FUNCTION_H_INCLUDED
Merci pour votre aide.
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 #include <Windows.h> #include <ing> #include "function.h" #include <sstream> #include <winsock.h> #include <MYSQL/mysql.h> #include <ctime> #include <vector> using namespace std; string getConfig(string section,string cle,string nomFichier) { string valeur; nomFichier=".//"+nomFichier; GetPrivateProfileStringA(section, cle, "0", valeur, 5, nomFichier ); return (valeur); }
Partager