236
votes

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?

Code

#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;
}

Output

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
     ^
5
  • 3
    You should probably use std::findeligne instead of using a \n character :)
    – Aliou
    Apr 1, 2014 at 8:31
  • 66
    It looks like a joke question for April 1st ..... Apr 1, 2014 at 8:32
  • 2
    Are you sure iostream is the correct name of the header in French? Apr 1, 2014 at 8:36
  • 9
    I think the problem lies in the language you have chosen.
    – ek9
    Apr 1, 2014 at 10:10
  • 2
    Don't look down on the compiler, he and I both got a hard time learning french. We're trying our best though, so give us at least 6-8 more weeks to learn! Apr 1, 2014 at 20:58

15 Answers 15

151
votes

The problem is obviously that you are including the wrong standard header:

#inclure <iostream>

should be:

#inclure <fluxes>

Also, you'll find that this works much better is you use Studio Visuel Micromou or the CCG (stands for "Collection de Compilateurs GPU", btw) tools, rather than their more common MVS or GCC relatives.

11
  • 5
    Also be careful to give your header files the extension « .e » for « en-tête » Apr 1, 2014 at 9:07
  • 2
    @ArlaudPierre: it turns out that you can use whatever extension you want for your header files, except for C-standard-library-header files which are required to use the .e extension. But of course, the standard extensions such as .e, .ee, .epp are preferred by convention... For details: stackoverflow.com/questions/441568/…
    – Martin J.
    Apr 1, 2014 at 9:35
  • @MartinJ. Right, although I didn't mean that it was mandatory when I said "be careful". Apr 1, 2014 at 9:40
  • 31
    GNPU n'est pas UNIX. Apr 1, 2014 at 12:36
  • 5
    I remember De Gaulle calling out "Vive le logiciel libre!"...
    – Axel
    Apr 1, 2014 at 17:19
111
votes
  1. You have a semantic error - the second argument of the entry function should be of type cara**, not ent**:

    ent principal(ent argn, cara** argm)
    
  2. For the <iostream> error, @MartinJ. already correctly pointed out you should be using <esflux> instead.

  3. Regarding the other errors, it seems your compiler is simply on strike. This can happen occasionally when compiling french code, and should fix itself in a few days.

0
62
votes

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:

  • You forgot to translate some keywords.
  • Beware that the compiler and the documentation don't always use the same translation for the same word.
  • You didn't account for the fact that adjectives come after the noun in French.
  • You're using the wrong type of quotes.

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
0
51
votes

I'm trying to compile this really basic program.

This is not a BASIC program, so Visual Studio does not know what to do with it.

In addition, on a French system, you need to pass a programme to the compiler.

2
  • 6
    "to pass a programme" <3 Apr 1, 2014 at 11:26
  • 5
    So what you're saying is, "Ceci n'est pas une programme BASIC." Apr 1, 2014 at 23:38
44
votes

Hello Légèreté fait la course en orbite,

I'd like to emphasize that even though you follow all the answers given here, your program still won't compile because of your punctuation. Semicolons are preceded by a non-breaking space in French.

I would recommend the following:

#inclure <esflux>

ent principal(ent narg, cara** marg)  // entier, nombre d'arguments, valeur des arguments
{
   std::cendehors << "Bonjour le monde !\n" ;
   renvoyer SORTIE_SUCCÈS ;
}

Please notice I changed argn to narg, as it is more natural in French (nothing to do with hungarian notations though)!

Edit: followed angew's recommendation

35
votes

Pretty much everything's been covered in the previous answers, but if I may add:

renvoyer SORTIE_SUCCÈS ; // correct, but bad pratice

this is certes allowed, but the following is usually preferred:

capitulation ; // a better, frenchier approach
1
  • 3
    ain't the two semantically equivalent in French C?
    – user719662
    Apr 1, 2014 at 18:44
17
votes

You need to reference the french pre-processor :

#inclure <Montebourg>

hummm... too late, it is deprecated. The new release will be available this week.

17
votes

I realize this doesn't apply to this particular situation, but it's important to keep in mind the gender of your objects when programming in French. There are 2 types of classes (genre) genre::masculins and genre::féminin

For instance:

genre::masculins Hommes {}
genre::féminin Femme {}

Furthermore, when passing this to another function the function call is prefixed with the parameter list rather than suffixed:

genre::masculins Croissant {
    nul nourrir(Hommes hommes) {
        hommes.(ce)manger ;
    }
}

or

genre::féminin Grenouille {
    nul nourrir(Hommes hommes) {
        hommes.(cette)manger;
    }
}

For further reference: Wikipedia Word Order

0
15
votes

What if you retry after lunch hours (12-2 pm) ? Also, if you get more then one processors, they may be on strike. You can get your proc back however with this (French) Windows 7 command:

set max-working-hours-a-week = 35

Repeat when you're stuck (but don't forget to lower the number each time!).

2
  • 2
    +1, and I think set pension-starting-age = 62 could also help, might change to set pension-starting-age = 60 soon...
    – Axel
    Apr 2, 2014 at 11:12
  • Of course, pension-starting-age could also do the trick! Où avais-je la tête? :-) Apr 2, 2014 at 11:34
10
votes

Seems you forgot to install the FrenChPP++ package. After a successful installation (you will need to compile FrenChPP++ on a standard c++ compiler if there are no binary packages for your system (we at the Unauthorized Frog recommend using g++ for this, but feel free to use clang too, but ignore the warnings)) you will need to create a new project, and just copy paste this into the newly created principal.fcpp file. Then upon execution the FrenChPP++ precompiler (which works very similarly to the way Qt handles its signals/slot mechanism) will parse all .fcpp files and will "translate" the .fcpp into valid .cpp and then compile them using your system default compiler.

1
7
votes

You probably need to install the French language pack for C++11. If you can't find it, try http://www.bing.com/translator.

7
votes

There are so many errors in your code, most of them have already been adressed in the other answers. But don't you know that the creators of C++ designed it so that program source code doesn't get obverly long when translated?

It's not std::cendehors, but std::deh (short for dehors) as std::cin translates to std::ded (for dedans).

Also note there used to be compilers that didn't automatically flush on \n, so it's better to use std::findl (fin de ligne). So it should be like this:

   std::deh << "Bonjour le monde!" << std::findl; 

EDIT: Sorry, I didn't spot another mistake. The correct form of course is using guillemets like this:

   std::deh << «Bonjour le monde!» << std::findl; 
3
  • 2
    Well spotted for the quotation marks
    – jwav
    Apr 1, 2014 at 19:34
  • Didn't those compilers still have to flush output when the process ended? Apr 1, 2014 at 22:45
  • 1
    @LightnessRacesinOrbit: Yes, in principle you are right, but beware of differences in implementaion in the french version as flushing in France may lead to undesired results (en.wikipedia.org/wiki/French_toilet).
    – Axel
    Apr 2, 2014 at 8:44
5
votes

You cannot use French keywords in a C++ (or C) program. You should code

 #include <iostream>
 //  ^^^  the english word "include" 

and likewise

 return EXIT_SUCCESS;

and of course code int main(int argc, char**argv) etc...

(thanks for your April fool's joke!)

7
  • 9
    Oh, really? It's always worked for me in the past. Is there some compiler flag I can set? Apr 1, 2014 at 8:29
  • maybe #define SORTIE_SUCCÈS EXIT_SUCCESS
    – Jerry1
    Apr 1, 2014 at 8:30
  • 1
    "il est manquant espace...": Whoever did the translation doesn't know French. (From experience: avoid translated versions of the the compiler. There are no formally established and universally agreed upon translations for many of the technical terms, and you'll end up trying to second guess the translators' choices in order to figure out what the error messages really mean.) Apr 1, 2014 at 8:38
  • 18
    @JamesKanze: So do you think Spanish may work better? Or? Apr 1, 2014 at 8:42
  • 2
    well then, there is a attemp to tranlaste C++, see FrenC github.com/carado/FranC, it's just a lot of #define :D
    – Lesto
    Apr 1, 2014 at 14:07
4
votes

Since Mr. George Bush banned French Fries in favour of the tastier Liberty Fries (and the less-tasty but equally patriotic Freedom Fries), other American corporations are also removing support for French in their products.

You need to use a pre-2003 compiler, or send a mail to http://www.whitehouse.gov/contact/submit-questions-and-comments to ask if they plan to revert the situation soon.

3
votes

Firstly, you need to

#inclure <clibstd>

before you're able to use SORTIE_SUCCÈS constant.

Another problem with your C++ code is that you've forgotten to use std::lend and instead used '\n' in your output string - it won't work in French code, obviously, only code written in English and Russian is allowed to do that.

Even more, you used wrong indentation (GCC on French requires tabs instead of spaces) and brace placement (you need to place braces on the same line whenever possible, no spaces between them allowed); keeping them unchanged will generate "vous ne connaissez pas votre tabulation, Jacques" and "pas assez d'amour entre accolades" runtime errors in your code.

After I changed those lines, the code successfully compiled. It still hasn't run, probably for the reasons specified here.

Snippet: http://ideone.fr/sQbL6E

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.