Why can't my program compile under Windows 7 in French? [closed]
Asked Answered
E

15

236

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
     ^
Esther answered 1/4, 2014 at 8:25 Comment(5)
You should probably use std::findeligne instead of using a \n character :)Meperidine
It looks like a joke question for April 1st .....Jacqualinejacquard
Are you sure iostream is the correct name of the header in French?Scone
I think the problem lies in the language you have chosen.Holub
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!Latoyalatoye
Z
62

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
Zildjian answered 1/4, 2014 at 18:28 Comment(0)
P
151

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.

Passus answered 1/4, 2014 at 8:35 Comment(11)
Also be careful to give your header files the extension « .e » for « en-tête »Swingletree
@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: #442068Passus
@MartinJ. Right, although I didn't mean that it was mandatory when I said "be careful".Swingletree
GNPU n'est pas UNIX.Headspring
@abuzittingillifirca: Well, sorry, not my fault if Richard Matthieu Hommétal decided it was "GPU n'est Pas Unix"...Passus
I remember De Gaulle calling out "Vive le logiciel libre!"...Retouch
IMO #inclure <fluxes> would make more sense for native french speakers.Grannie
@tehinternetsismadeofcatz: completely agree, but I also thought it might be harder to get the joke as one may think it's just the plural of 'flux'Passus
Isn't it <iofluxes>?Kippar
"iostreams" ~ "in/out streams" -> "flux entrée/sortie" ~ "fluxes", but I agree it's abit confusing, which is why it was initally named "esflux", which turned out to be grammatically incorrect.Passus
@Arnaud: of course, Micromou, the famous software company founded by Guillaume Portes, Stéphane Boulemère and, well... Paul Allen.Passus
D
111
  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.

Disorientate answered 1/4, 2014 at 9:12 Comment(0)
Z
62

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
Zildjian answered 1/4, 2014 at 18:28 Comment(0)
G
51

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.

Grow answered 1/4, 2014 at 11:18 Comment(2)
"to pass a programme" <3Swingletree
So what you're saying is, "Ceci n'est pas une programme BASIC."Numeration
S
44

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

Swingletree answered 1/4, 2014 at 9:11 Comment(0)
J
35

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
Josephus answered 1/4, 2014 at 13:11 Comment(1)
ain't the two semantically equivalent in French C?Ossification
S
17

You need to reference the french pre-processor :

#inclure <Montebourg>

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

Supranational answered 1/4, 2014 at 13:30 Comment(0)
M
17

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

Malherbe answered 1/4, 2014 at 14:10 Comment(0)
S
15

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!).

Sabella answered 1/4, 2014 at 15:0 Comment(2)
+1, and I think set pension-starting-age = 62 could also help, might change to set pension-starting-age = 60 soon...Retouch
Of course, pension-starting-age could also do the trick! Où avais-je la tête? :-)Sabella
B
10

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.

Beeswing answered 1/4, 2014 at 8:59 Comment(1)
Here is a link: github.com/carado/FranCFlory
B
7

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

Biliary answered 1/4, 2014 at 8:45 Comment(0)
R
7

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; 
Retouch answered 1/4, 2014 at 17:17 Comment(3)
Well spotted for the quotation marksJosephus
Didn't those compilers still have to flush output when the process ended?Esther
@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).Retouch
J
5

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!)

Jacqualinejacquard answered 1/4, 2014 at 8:27 Comment(7)
Oh, really? It's always worked for me in the past. Is there some compiler flag I can set?Esther
maybe #define SORTIE_SUCCÈS EXIT_SUCCESSTropism
@LightnessRacesinOrbit No. inclure is not a keyword for the preprocessor, and there is no way of making it one. renvoi is not a keyword either, but there could always be a #define renvoi return somewhere, although except for obfuscation, I'd avoid this.Neese
Now it says principal.cpp:1:20: attention: il est manquant espace après le nom de la macro [activé par défaut] :(Esther
"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.)Neese
@JamesKanze: So do you think Spanish may work better? Or?Esther
well then, there is a attemp to tranlaste C++, see FrenC github.com/carado/FranC, it's just a lot of #define :DNortheast
B
4

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.

Buryat answered 1/4, 2014 at 22:1 Comment(0)
O
3

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

Ossification answered 1/4, 2014 at 16:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.