我正在运行Windows 7法语,我试图编译这个真正基本的程序,但Visual Studio是固执的,拒绝遵守。我也尝试在Coliru上用GCC 4.7和Clang trunk编译它,我得到或多或少相同的错误(输出在代码下面),尽管我认为Coliru运行在英语操作系统上,所以我不期望它无论如何都能工作。

我做错了什么?我该怎么解决呢?

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

输出

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
     ^

当前回答

自从乔治·布什总统为了支持更美味的自由薯条(以及不那么美味但同样爱国的自由薯条)而禁止炸薯条以来,其他美国公司也在他们的产品中取消了对法语的支持。

您需要使用2003年以前的编译器,或者发送邮件到http://www.whitehouse.gov/contact/submit-questions-and-comments,询问他们是否计划很快恢复这种情况。

其他回答

之前的答案几乎涵盖了所有内容,但如果我可以补充一句:

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

这当然是允许的,但以下通常是首选:

capitulation ; // a better, frenchier approach

您可能需要为c++ 11安装法语语言包。如果你找不到,试试http://www.bing.com/translator。

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.

问题很明显,你包含了错误的标准头文件:

#inclure <iostream>

应该是:

#inclure <fluxes>

此外,你会发现,如果你使用Studio visual Micromou或CCG(代表“Collection de Compilateurs GPU”,顺便说一下)工具,而不是它们更常见的MVS或GCC亲戚,效果会更好。

你需要引用法语预处理器:

#inclure <Montebourg>

嗯……太晚了,它已被弃用。新版本将于本周发布。