Support #3211
closedError with std::bind()
0%
Description
Hi,
I am trying to build a small application with Wt. Following code works well in Ubuntu, but not with the CentOS with g version 4.4.7,
button->clicked().connect([=] (const Wt::WMouseEvent& e) {
host_ = Wt::asString(host->text()).toUTF8();
port_ = Wt::asString(port->text()).toUTF8();
user_ = Wt::asString(user->text()).toUTF8();
pass_ = Wt::asString(pass->text()).toUTF8();
db_ = Wt::asString(db->text()).toUTF8();
table_ = Wt::asString(tb->text()).toUTF8();
rFunction();
vizFunction();
});
In CentOS, I'm getting the following error,
error: expected primary-expression before '[' token
error: expected primary-expression before '=' token
error: expected primary-expression before ']' token
I have very little experience in C, having hard time in understanding these.
Any work around to solve this?
Thank you,
Manoj G
Updated by Manoj G over 11 years ago
Hi,
I have tried with the following code in CentOS with gcc 6.4.7 and not the above one. Sorry for this error,
>button->clicked().connect(std::bind([=]() {
host_ = Wt::asString(host->text()).toUTF8();
port_ = Wt::asString(port->text()).toUTF8();
user_ = Wt::asString(user->text()).toUTF8();
pass_ = Wt::asString(pass->text()).toUTF8();
db_ = Wt::asString(db->text()).toUTF8();
table_ = Wt::asString(tb->text()).toUTF8();
rFunction();
vizFunction();
}));
Regards,
Manoj G
Updated by Wim Dumon over 11 years ago
- Status changed from New to Closed
See my response here:
http://redmine.emweb.be/boards/2/topics/9101
BR,
wim.
Updated by Manoj G over 11 years ago
Got it. Thanks Wim. Sorry for posting this here :)
Regards,
Manoj G