Results 1 to 4 of 4

Thread: Boken Compiler?

  1. #1
    Join Date
    Feb 2007
    Beans
    29

    Boken Compiler?

    Hi, I am trying to compile a basic C++ program and I am getting a funny error. I have compiled C++ programs on this machine before, but now it being weird. I think there is a problem with my linker. Here is my C++ code
    Code:
    #include <iostream>
     using namespace std;
    
     int main () 
     {
       cout << "Hello World!";
       return 0;
      }
    and here is the error I'm getting
    Code:
    /usr/bin/ld: Undefined symbols:
    std::ios_base::Init::Init()
    std::ios_base::Init::~Init()
    std::cout
    std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
    ___gxx_personality_v0
    collect2: ld returned 1 exit status
    any ideas?

  2. #2
    Join Date
    Jul 2005
    Beans
    1,535
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Boken Compiler?

    make sure you are using g++ to compile C++ code, not gcc.
    When I invented the Web, I didn't have to ask anyone's permission.
    ~Tim Berners-Lee on Net Neutrality
    -------------------------------------
    Visit the Ubuntu Programming IRC-channel at #ubuntu-programming (chat.freenode.net).

  3. #3
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,715

    Re: Boken Compiler?

    Have you installed "build-essential"?

    If not, type this in the command line:
    Code:
    sudo apt-get install build-essential
    That tends to be a VERY VERY common problem so it's worth a shot.

  4. #4
    Join Date
    Feb 2007
    Beans
    29

    Re: Boken Compiler?

    Quote Originally Posted by hod139 View Post
    make sure you are using g++ to compile C++ code, not gcc.
    I now feel like a complete and absolute noob... V.V
    I'm going to go cut my self

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •