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

当前回答

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.

其他回答

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.

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

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

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

#inclure <iostream>

应该是:

#inclure <fluxes>

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

首先,你需要

#inclure <clibstd>

才能使用SORTIE_SUCCÈS constant。

c++代码的另一个问题是,你忘记了使用std::lend,而在输出字符串中使用了'\n'——这在法语代码中行不通,显然,只有用英语和俄语编写的代码才允许这样做。

更重要的是,您使用了错误的缩进(法语上的GCC要求制表符而不是空格)和大括号放置(您需要尽可能将大括号放置在同一行上,它们之间不允许有空格);保持不变将在代码中产生“vous ne connaissez pas votre tabulation, Jacques”和“pas assez d'amour entre accolades”运行时错误。

在我更改这些行之后,代码成功编译。它仍然没有运行,可能是由于这里指定的原因。

片段:http://ideone.fr/sQbL6E

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

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

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