iostream错误。 [英] iostream error.
问题描述
大家好,
我正在执行简单的hello world程序。但是,得到编译时间
错误。
这里有什么问题?
prasad @ D-T11673A:〜/ program / c取代; cat bst.cpp
#include< iostream>
使用命名空间std;
int main()
{
cout<< Hello World。 ;
返回0;
}
prasad @ D-T11673A:〜/ programs / c> gcc bst.cpp
/tmp/ccrmoRpD.o:在函数`main'':
bst.cpp :(。text + 0x25):未定义引用`std :: cout''
bst.cpp :(。text + 0x2a):未定义引用`std :: basic_ostream< char,
std :: char_traits< char> >&安培;的std ::运营商LT;< < std :: char_traits< char>
(std :: basic_ostream< char,std :: char_traits< char>>&,char const *)''
>
/tmp/ccrmoRpD.o:在函数`__tcf_0'':
bst.cpp :(。text + 0x47):未定义引用
`std :: ios_base :: Init :: ~Init()''
/tmp/ccrmoRpD.o:函数中
`__static_initialization_and_destruction_0(int,int )'':
bst.cpp :(。text + 0x74):未定义的引用
`std :: ios_base :: Init :: Init()''
/tmp/ccrmoRpD.o:(.eh_frame+0x11):未定义引用
`__gxx_personality_v0''
collect2:ld返回1退出状态
prasad @ D-T11673A:〜/ programs / c> echo $?
1
谢谢&问候,
Prasad
?
1
谢谢&问候,
Prasad
Prasad写道:大家好,
这里有什么问题?
prasad @ D-T11673A:〜/ programs / c> cat bst.cpp
#include< iostream>
使用命名空间std;
int main()
{
cout<< ; Hello World。 ;
返回0;
}
prasad @ D-T11673A:〜/ programs / c> gcc bst.cpp
使用g ++。
-
Ian Collins。
Prasad写道:大家好,
我正在执行简单的hello world程序。但是,编译时错误。
这里有什么问题?
prasad @ D-T11673A:〜/ programs / c> cat bst.cpp
#include< iostream>
使用命名空间std;
int main()
{
cout<< ; Hello World。 ;
返回0;
}
prasad @ D-T11673A:〜/ programs / c> gcc bst.cpp
/tmp/ccrmoRpD.o:在函数`main'':
bst.cpp :(。text + 0x25):未定义引用`std :: cout''
bst.cpp :(。text + 0x2a):未定义的引用`std :: basic_ostream< char,
std :: char_traits< char> >&安培;的std ::运营商LT;< < std :: char_traits< char>(std :: basic_ostream< char,std :: char_traits< char>>&,char const *)''>
/tmp/ccrmoRpD.o:在函数`__tcf_0'':
bst.cpp :(。text + 0x47):未定义引用
`std :: ios_base :: Init: :~Init()''
/tmp/ccrmoRpD.o:在函数中
`__static_initialization_and_destruction_0(int,int)'':
bst.cpp :(。text + 0x74):undefined引用
`std :: ios_base :: Init :: Init()''
/tmp/ccrmoRpD.o:(.eh_frame+0x11):未定义引用
`__gxx_personality_v0''
collect2:ld返回1退出状态
prasad @ D-T11673A:〜/ programs / c>回声
Hi All,
I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?
prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>
using namespace std;
int main ()
{
cout << "Hello World." ;
return 0 ;
}
prasad@D-T11673A:~/programs/c> gcc bst.cpp
/tmp/ccrmoRpD.o: In function `main'':
bst.cpp:(.text+0x25): undefined reference to `std::cout''
bst.cpp:(.text+0x2a): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>(std::basic_ostream<char, std::char_traits<char> >&, char const*)''
/tmp/ccrmoRpD.o: In function `__tcf_0'':
bst.cpp:(.text+0x47): undefined reference to
`std::ios_base::Init::~Init()''
/tmp/ccrmoRpD.o: In function
`__static_initialization_and_destruction_0(int, int)'':
bst.cpp:(.text+0x74): undefined reference to
`std::ios_base::Init::Init()''
/tmp/ccrmoRpD.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0''
collect2: ld returned 1 exit status
prasad@D-T11673A:~/programs/c> echo $?
1
Thanks & regards,
Prasad
解决方案?
1
Thanks & regards,
Prasad
Prasad wrote:Hi All,
I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?
prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>
using namespace std;
int main ()
{
cout << "Hello World." ;
return 0 ;
}
prasad@D-T11673A:~/programs/c> gcc bst.cpp
Use g++.
--
Ian Collins.
Prasad wrote:Hi All,
I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?
prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>
using namespace std;
int main ()
{
cout << "Hello World." ;
return 0 ;
}
prasad@D-T11673A:~/programs/c> gcc bst.cpp
/tmp/ccrmoRpD.o: In function `main'':
bst.cpp:(.text+0x25): undefined reference to `std::cout''
bst.cpp:(.text+0x2a): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>(std::basic_ostream<char, std::char_traits<char> >&, char const*)''
/tmp/ccrmoRpD.o: In function `__tcf_0'':
bst.cpp:(.text+0x47): undefined reference to
`std::ios_base::Init::~Init()''
/tmp/ccrmoRpD.o: In function
`__static_initialization_and_destruction_0(int, int)'':
bst.cpp:(.text+0x74): undefined reference to
`std::ios_base::Init::Init()''
/tmp/ccrmoRpD.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0''
collect2: ld returned 1 exit status
prasad@D-T11673A:~/programs/c> echo
这篇关于iostream错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!