GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

'cout' is not a member of 'std'?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Jamiil
Familiar Face


Joined: 22 Sep 2005
Posts: 20

PostPosted: Thu Sep 29, 2005 4:40 pm    Post subject: 'cout' is not a member of 'std'? Reply with quote

When trying to compile the below program, I get a message saying that 'cout' is not a member of 'std', what the heck is that message for?!

Is this a bug in g++

SPECS -
MSW-XP
DEV-CPP - MINWING - GCC 3.3.x

#include <gtkmm/button.h>
#include <gtkmm/window.h>
#include <gtkmm/main.h>
#include <string>

class HelloWorld : virtual public Gtk::Window{
public:
HelloWorld();
virtual ~HelloWorld();

protected:
//Signal handlers:
virtual void on_button_clicked();

//Member widgets:
Gtk::Button m_button;
};
// creates a new button with the label "Hello World".
HelloWorld::HelloWorld() : m_button("Hello World"){

// Sets the border width of the window.
set_border_width(10);

// When the button receives the "clicked" signal, it will call the
// on_button_clicked() method. The on_button_clicked() method is defined below.
m_button.signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::on_button_clicked));

// This packs the button into the Window (a container).
add(m_button);

// The final step is to display this newly created widget...
m_button.show();
}

HelloWorld::~HelloWorld(){}
/* ?????????????????????? HERE IS THE PROBLE ????????????????? */
void HelloWorld::on_button_clicked(){
std::cout << "Hello World" << std::endl;
}

int main (int argc, char *argv[])
{
Gtk::Main kit(argc, argv);

HelloWorld helloworld;
Gtk::Main::run(helloworld); //Shows the window and returns when it is closed.

return 0;
}
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 387
Location: Fairfax, Virginia

PostPosted: Thu Sep 29, 2005 5:03 pm    Post subject: Reply with quote

You need to include <iostream>...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP