Project

General

Profile

Actions

Support #3211

closed

Error with std::bind()

Added by Anonymous over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Target version:
-
Start date:
05/26/2014
Due date:
% Done:

0%

Estimated time:

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

Actions #1

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

Actions #2

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.

Actions #3

Updated by Manoj G over 11 years ago

Got it. Thanks Wim. Sorry for posting this here :)

Regards,

Manoj G

Actions

Also available in: Atom PDF