I have this code (from https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate )
class PiWorker : public NanAsyncWorker {
public:
PiWorker( NanCallback *callback, NanUtf8String sz_QMN )
: NanAsyncWorker( callback ) {}
~PiWorker() {}
void Execute() {
printf( "(cc)>>>> qmn [%s].\n", sz_QMN ) ; .... line 52
... and compiler says
..\mqconn.cc(52): error C2065: 'sz_QMN' : undeclared identifier
How can it be ?
Did you declare
sz_QMN
as private member?From the nan example, the
Execute()
function only access the private members.You can initialize the
sz_QMN
private member in your constructor: