Skip to content
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

opencv v1.0.0 refuses to compile with nan v1.5.1 #213

Closed
aujang opened this issue Jan 16, 2015 · 7 comments
Closed

opencv v1.0.0 refuses to compile with nan v1.5.1 #213

aujang opened this issue Jan 16, 2015 · 7 comments

Comments

@aujang
Copy link

aujang commented Jan 16, 2015

nan recently updated from v1.43 --> 1.5.1, and this causes the following build issue:

../src/Matrix.cc:1266:11: warning: address of local variable ‘ret’ returned [-Wreturn-local-addr]
cv::Rect ret;
^
In file included from ../node_modules/nan/nan.h:63:0,
from ../src/OpenCV.h:12,
from ../src/Contours.h:1,
from ../src/Matrix.cc:1:
../node_modules/nan/nan_new.h: In instantiation of ‘typename NanIntern::Factory::return_t NanNew(A0) [with T = v8::Integer; A0 = long unsigned int; typename NanIntern::Factory::return_t = v8::Localv8::Integer]’:
../src/Matrix.cc:453:81: required from here
../node_modules/nan/nan_new.h:184:41: error: call of overloaded ‘New(long unsigned int&)’ is ambiguous
return NanIntern::Factory::New(arg0);
^
../node_modules/nan/nan_new.h:184:41: note: candidates are:
In file included from ../node_modules/nan/nan.h:63:0,
from ../src/OpenCV.h:12,
from ../src/Contours.h:1,
from ../src/Matrix.cc:1:
../node_modules/nan/nan_new.h:86:26: note: static NanIntern::IntegerFactory::return_t NanIntern::IntegerFactory::New(int32_t) [with T = v8::Integer; NanIntern::IntegerFactory::return_t = v8::Localv8::Integer; int32_t = int]
static inline return_t New(int32_t value);
^
../node_modules/nan/nan_new.h:87:26: note: static NanIntern::IntegerFactory::return_t NanIntern::IntegerFactory::New(uint32_t) [with T = v8::Integer; NanIntern::IntegerFactory::return_t = v8::Localv8::Integer; uint32_t = unsigned int]
static inline return_t New(uint32_t value);
^
In file included from ../node_modules/nan/nan.h:63:0,
from ../src/OpenCV.h:12,
from ../src/Contours.h:1,
from ../src/Matrix.cc:1:
../node_modules/nan/nan_new.h: In function ‘typename NanIntern::Factory::return_t NanNew(A0) [with T = v8::Integer; A0 = long unsigned int; typename NanIntern::Factory::return_t = v8::Localv8::Integer]’:
../node_modules/nan/nan_new.h:185:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: *** [Release/obj.target/opencv/src/Matrix.o] Error 1

This can be fixed by forcing nan version 1.4.3 in the project's package.json, but I thought I should bring it to your attention.

@bobmoff
Copy link
Contributor

bobmoff commented Jan 17, 2015

Thanks, your "fix" worked for me!

@esconone
Copy link

Thanks, it works for me.

@ralyodio
Copy link

how do i implement this fix?

@bobmoff
Copy link
Contributor

bobmoff commented Jan 21, 2015

Fork the repo, modify the nan depency to exactly 1.4.3 and use that new repo as a depency in your package.js

This is the fork i did: https://github.com/IMGNRY/node-opencv and use, which works.

@peterbraden
Copy link
Owner

I'm gonna use your fix until I can test with recent versions of nan.

@aujang
Copy link
Author

aujang commented Jan 26, 2015

Glad I could help. :)

@peterbraden
Copy link
Owner

Closed by #218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants