I'm running Windows 7 French and I'm trying to compile this really basic program, but Visual Studio is being stubborn and refuses to comply. I also tried compiling it with both GCC 4.7 and Clang trunk on Coliru and I get more or less the same errors (output is below the code), though I think Coliru runs on an English OS so I wouldn't expect it to work anyway.
What am I doing wrong? And how can I fix it?
#inclure <iostream>
ent principal(ent argn, ent** argm) // entier, nombre d'arguments, valeur des arguments
{
std::cendehors << "Bonjour le monde!\n";
renvoi SORTIE_SUCCÈS;
}
principal.cpp:1:6: erreur: prétraitement de la directive invalide #inclure
#inclure <iostream>
^
principal.cpp:6:8: erreur: '\303' égaré dans le programme
renvoi SORTIE_SUCCÈS;
^
principal.cpp:6:8: erreur: '\210' égaré dans le programme
principal.cpp:3:5: erreur: «ent» ne désigne pas un type
ent principal(ent argn, ent** argm) // entier, nombre d'arguments, value des arguments
^
Many problems are due to caching, but yours is one of the other kind of hard problems: naming things. Yes, localization is hard.
You didn't mention which variant of French you're using, but from the error message, I think you're using “French (France)” (what we users of civilized OSes call fr_FR
). MS's fr_FR
locale behaves in a very weird way: uppercase accented letters are mapped to their unaccented counterpart (for backward compatibility with some typewriter models). So you need to write SORTIE_SUCCES
instead of SORTIE_SUCCÈS
.
A workaround is to use the “French (Monaco)” (fr_MC
) language, where uppercase accented letters work as expected. Unfortunately, the Monaco version of the compiler is very very expensive. You could also use the Canadian French, Belgian French or Swiss French version, but these all require that you submit a bilingual (fr_CA
+ en_CA
), trilingual (fr_BE
+ nl_BE
+ de_BE
) or quadrilingual (fr_CH
+ it_CH
+ de_CH
+ rm_CH
) source file. African variants of French are out because they are too poor to afford a C++ compiler, however you could use C instead.
Then there are other syntax errors in your program:
I wollun tried the following code in the C++ compiler included in Émaxe 51,70, and it wollun worked:
#inclure <fluxes>
principal ent(argn ent, argm **ent) // entier, nombre d'arguments, valeur des arguments
{
norme::sortiec << « Bonjour à tout le monde !\n » ;
retourner SORTIE_SUCCÈS ;
}
Some languages have better internationalization support than C++. For example, here's a program in LOGO (not to be confused with LOGO of course).
pour exemple
répète 18 [av 5 td 10]
td 60
répète 18 [av 5 td 10]
fin