-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inquiry with file node-addon-examples/5_function_factory/node_0.12/addon.cc #99
Comments
Sample Function would have to be a static function and you would need use the & modifier to get the address of the function. If that does not clarify it for you I think you'd need to paste the code that is not working for you. |
@mhdawson Hi, I've tried everything I can think of, including this answer that shows how to do it, but unfortunately, that doesn't work either, I'm guessing because it's either outdated, or I'm just an idiot, but the error message is the same:
|
@J-Cake do you have a link to your code and the line that it reports the error on? |
@mhdawson Hi, yes, I do have an example of the code, here. The error is this:
It would also be worth mentioning the declaration of the
|
Ok so I missed that you are not using N-API? The examples are more up to date and supported on that side of things. Can you not use N-API for some reason? |
I'm not using N-API because in my opinion, it's best to learn a language/framework without additional layers of abstraction first, plus libraries in general just don't seem to work. As in, they simply won't compile. But I'll look into it. |
Hi, anyone reading this,
The file
node-addon-examples/5_function_factory/node_0.12/addon.cc
contains a function factory, that's all well and good, but when I do something similiar, instead of using a global function, I'm using an instance function, (sorry, bad C++ vocab, I'm only new...) a function that's a private member of a class, and I want to use that as the function body, where the example usesas the body. The issue is I get an error when doing this, the error is as follows:
error C3867: 'Class::SampleFunction': non-standard syntax; use '&' to create a pointer to member
and I have no idea what to do about it.The text was updated successfully, but these errors were encountered: