使用Cygwin进行编译时出错 [英] Error when compiling with Cygwin
问题描述
你好,
我刚做了一个小小的C ++控制台应用程序:
using namespace std;
int main()
{
cout<< Hello Mars!;
返回0;
}
但是当我尝试用Cygwin编译它时。
gcc main.cpp -o main.exe
它给了我以下错误:
http://users.pandora.be/rz6hkk/cygwin.png
我听说有一些新的*现代* c ++语言?!
Hello,
I just made a little C++ console application:
#include "iostream"
using namespace std;
int main ()
{
cout << "Hello Mars !";
return 0;
}
But when i tryed to compile it with Cygwin.
gcc main.cpp -o main.exe
It gave me the following error:
http://users.pandora.be/rz6hkk/cygwin.png
I heard there is some new *modern* c++ language ?!
推荐答案
TuPLaD写道:
TuPLaD wrote:
你好,我刚刚做了一个小的C ++控制台应用程序:
#include" iostream"
using namespace std;
int main()
{
cout<< Hello Mars!;
返回0;
}
但是当我尝试用Cygwin编译它时。
gcc main.cpp -o main.exe
如果要编译和链接C ++代码,请使用g ++,而不是gcc。由于你好像b $ b似乎在使用Windows,因此名称可能不同(AFAIK,Windows
不支持''''作为文件名的一部分)。
它给了我以下错误:
http://users.pandora.be/rz6hkk/cygwin.png
您制作了编译器输出的截图!?为什么不将它粘贴到消息中?
我听说有一些新的*现代* c ++语言?!
Hello,
I just made a little C++ console application:
#include "iostream"
using namespace std;
int main ()
{
cout << "Hello Mars !";
return 0;
}
But when i tryed to compile it with Cygwin.
gcc main.cpp -o main.exe
If you want to compile and link C++ code, use g++, not gcc. Since you
seem to be using windows, the name might be different (AFAIK, Windows
doesn''t support ''+'' as part of file names).
It gave me the following error:
http://users.pandora.be/rz6hkk/cygwin.png
You made a screenshot of your compiler output!? Why not just paste it
into the message?
I heard there is some new *modern* c++ language ?!
最后一个C ++标准版本是从2003开始的,但除了一些小的
更正外,它与C ++ 98相同。
The last C++ standard version is from 2003, but except for a few minor
corrections, it''s the same as C++98.
" Rolf Magnus" < RA ****** @ t-online.de>在消息中写道
news:cg ************* @ news.t-online.com ...
"Rolf Magnus" <ra******@t-online.de> wrote in message
news:cg*************@news.t-online.com...
TuPLaD写道:
如果要编译和链接C ++代码,请使用g ++,而不是gcc。由于您似乎在使用Windows,因此名称可能不同(AFAIK,Windows
不支持''''作为文件名的一部分)。
TuPLaD wrote:
If you want to compile and link C++ code, use g++, not gcc. Since you
seem to be using windows, the name might be different (AFAIK, Windows
doesn''t support ''+'' as part of file names).
这个名字在Windows上也是g ++。
-Sharad
The name is g++ on Windows too.
-Sharad
TuPLaD < SP ***** @ pandora.be>在留言中写道
新闻:a2 ************************** @ posting.google.c om ...
"TuPLaD" <sp*****@pandora.be> wrote in message
news:a2**************************@posting.google.c om...
您好,我刚刚制作了一个小的C ++控制台应用程序:
#include" iostream"
使用命名空间std;
int main()
{
cout<< Hello Mars!;
返回0;
}
但是当我尝试用Cygwin编译它时。
gcc main.cpp -o main.exe
它给了我以下错误:
http://users.pandora.be/rz6hkk/cygwin.png
我没办法点击这样的链接......谁知道我可以下载什么样的病毒?
如果您有编译错误,请将其复制并粘贴到此处,或者至少告诉
我们说的是什么。
我听说有一些新的*现代* c ++语言?!
Hello,
I just made a little C++ console application:
#include "iostream"
using namespace std;
int main ()
{
cout << "Hello Mars !";
return 0;
}
But when i tryed to compile it with Cygwin.
gcc main.cpp -o main.exe
It gave me the following error:
http://users.pandora.be/rz6hkk/cygwin.png
No way am I clicking on a link like that...who knows what kind of virus I
might download!
If you''ve got a compiler error, either copy&paste it here, or at least tell
us what it says.
I heard there is some new *modern* c++ language ?!
与之相反,古代是指古代。 C ++语言?那么问题是什么呢?
呢?当然没有改变C ++会导致这样简单的代码在以前工作时失败。
(顺便提一下,通常的方法包含标准标题是在<>括号中包含
名称,而不是"引号。我相信使用括号
会导致编译器搜索对于那些标题不同于使用
引号时。不知道这是不是你的问题,因为我不知道是什么
错误信息你''得到。)
-Howard
As opposed to what, the "ancient" C++ language? And what would it have to
do with the problem? Surely no change has been made to C++ that would cause
such simple code to fail when it used to work.
(By the way, the usual method of including standard headers is to enclose
the name in <> brackets, not "" quotes. I believe that using the brackets
causes the compiler to search for those headers differently than when using
quotes. No idea if that''s your problem, though, because I don''t know what
error message you''re getting.)
-Howard
这篇关于使用Cygwin进行编译时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!