我正在运行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
     ^

当前回答

如果你在午餐时间之后(中午12点到2点)再试一次会怎样?此外,如果你有一个以上的处理器,他们可能会罢工。你可以用下面(法语)Windows 7命令返回你的proc:

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

当你陷入困境时,重复这一步骤(但别忘了每次都降低数字!)。

其他回答

你的代码中有这么多错误,其中大多数已经在其他答案中解决了。但你不知道c++的创造者设计它是为了让程序源代码在翻译时不会太长吗?

它不是std::cendehors,而是std::deh (dehors的缩写),因为std::cin翻译为std::ded (dedeans)。

还请注意,过去有编译器不会自动刷新\n,所以最好使用std::findl (fin de ligne)。所以应该是这样的:

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

编辑:对不起,我没有发现另一个错误。正确的形式当然是使用这样的guillemets:

   std::deh << «Bonjour le monde!» << std::findl; 

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

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

我正在编译这个非常基本的程序。

这不是一个BASIC程序,所以Visual Studio不知道用它做什么。

此外,在法语系统上,需要将程序传递给编译器。

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

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

#inclure <iostream>

应该是:

#inclure <fluxes>

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