Skip to main content

Thread: code blocks and c++


hello

use code blocks , c++ in ubuntu 10.04
iused code
code:
#include <iostream>  using namespace std;  int main() {     cout << "hello world!" << endl;     return 0; }
and won't work

build log shows
code:
 -------------- build: debug in aa ---------------  compiling: main.cpp linking console executable: bin/debug/aa obj/debug/main.o: in function `main': /home/user/desktop/aa/main.cpp:7: undefined reference `std::cout' /home/user/desktop/aa/main.cpp:7: undefined reference `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /home/user/desktop/aa/main.cpp:7: undefined reference `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' /home/user/desktop/aa/main.cpp:7: undefined reference `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))' obj/debug/main.o: in function `__static_initialization_and_destruction_0': /usr/include/c++/4.4/iostream:72: undefined reference `std::ios_base::init::init()' /usr/include/c++/4.4/iostream:72: undefined reference `std::ios_base::init::~init()' obj/debug/main.o:(.eh_frame+0x12): undefined reference `__gxx_personality_v0' collect2: ld returned 1 exit status process terminated status 1 (0 minutes, 0 seconds) 7 errors, 0 warnings
what should ??

try compiling code c++ project, not c project. if don't know how this, refer code blocks documentation.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk code blocks and c++


Ubuntu

Comments

Popular posts from this blog

Internal Server Errors - Joomla! Forum - community, help and support

CS6でファイルが開けません

Scrollability in divs or text boxes