为什么我的程序无法在Windows 7法语下编译? [英] Why can't my program compile under Windows 7 in French?

查看:51
本文介绍了为什么我的程序无法在Windows 7法语下编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Windows 7 French,并且试图编译这个非常基本的程序,但是Visual Studio固执并且拒绝遵守.我还尝试在 Coliru 上使用GCC 4.7和Clang干线对其进行编译,但我得到的错误大致相同(输出低于代码),尽管我认为Coliru在英语操作系统上运行,所以我不希望它能正常工作.

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?

#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
     ^

推荐答案

许多问题都归因于缓存,但是您的问题是另一种困难的问题:命名事物.是的,本地化很难.

Many problems are due to caching, but yours is one of the other kind of hard problems: naming things. Yes, localization is hard.

您没有提到您正在使用哪种法语版本,但是从错误消息中,我认为您正在使用法语(法国)"(我们文明的OS用户称其为 fr_FR ).MS的 fr_FR 区域设置表现得很怪异:大写带重音的字母映射到其无重音的对应字母(以实现与某些打字机模型的向后兼容性).因此,您需要编写 SORTIE_SUCCES 而不是SORTIE_SUCCÈS.

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.

要使用一种解决方法法语(摩纳哥)"( fr_MC )语言,其中大写带重音的字母可以正常工作.不幸的是,摩纳哥版本的编译器非常昂贵.您也可以使用加拿大法语,比利时法语或瑞士法语版本,但是所有这些都要求您提交双语( fr_CA + en_CA ),双语( fr_BE + nl_BE + de_BE )或四语言( fr_CH + it_CH + de_CH + rm_CH )源文件.法语的非洲变体之所以流行,是因为它们太穷而无法提供C ++编译器,但是您可以改用C.

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:

  • 您忘记翻译一些关键字了.
  • 请注意,编译器和文档不一定总是对同一单词使用相同的翻译.
  • 您没有考虑形容词在法语中紧随名词之后的事实.
  • 您使用的引号类型错误.

我wollun在Émaxe51,70附带的C ++编译器中尝试了以下代码,并且wollun起作用了:

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

某些语言比C ++具有更好的国际化支持.例如,这是 LOGO 中的程序(不要与徽标当然).

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

这篇关于为什么我的程序无法在Windows 7法语下编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆