Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
您需要使用以下方式编译它:
您引用的文件缺少
#include
指令,如果您也将其包含在文件中,则一切都会正常编译。You'll need to compile it using:
The file you are referring has a missing
#include <cstdlib>
directive, if you also include that in your file, everything shall compile fine.编译器告诉您,在奇怪的 FBI-CIA 警告消息中间的第 122 行开始存在问题。该消息不是有效的 C++ 代码,并且没有被注释掉,因此它当然会导致编译器错误。尝试删除整条消息。
另外,我同意 In silico 的观点:您应该始终告诉我们您尝试了什么以及您收到的具体错误消息。
The compiler is telling you that there are problems starting at line 122 in the middle of that strange FBI-CIA warning message. That message is not valid C++ code and is NOT commented out so of course it will cause compiler errors. Try removing that entire message.
Also, I agree with In silico: you should always tell us what you tried and exactly what error messages you got.
只需键入代码并将其保存为 .cpp 格式即可。然后尝试“gcc filename.cpp”。这将创建目标文件。然后尝试“./a.out”(这是默认的目标文件名)。如果你想了解 gcc,你可以随时尝试“man gcc”
Just type the code and save it in .cpp format. then try "gcc filename.cpp" . This will create the object file. then try "./a.out" (This is the default object file name). If you want to know about gcc you can always try "man gcc"