codeboost / opencv-node

Use OpenCV with node.js
54 stars 9 forks source link

linux compile #2

Closed morgangiraud closed 11 years ago

morgangiraud commented 11 years ago

Hi,

I've always successfully installed opencv-node so far, but i just tried to move it to my production server. I get stuck at this point because he is missing some files. (i've tried to handle it with npm install opencv-node and also by install bea and cloning the repo manually) Here is the output when i try to build it manually :

CXX(target) Release/obj.target/addon/src/opencv_manual.o ../src/opencv_manual.cpp:1:18: warning: cv.hpp: No such file or directory ../src/opencv_manual.cpp:6:16: warning: cv.h: No such file or directory In file included from ../src/opencv_manual.cpp:5: ../src/customTypes.h:9: error: 'cv' was not declared in this scope ../src/customTypes.h:9: error: template argument 1 is invalid ../src/customTypes.h:45: error: 'cv' was not declared in this scope ../src/customTypes.h:45: error: template argument 1 is invalid ../src/customTypes.h:79: error: 'cv' was not declared in this scope ../src/customTypes.h:79: error: template argument 1 is invalid ../src/customTypes.h:119: error: 'cv' was not declared in this scope ../src/customTypes.h:119: error: template argument 1 is invalid ../src/customTypes.h:119: error: template argument 2 is invalid ../src/customTypes.h:119: error: template argument 1 is invalid ../src/opencv_manual.cpp:8: error: 'cv' is not a namespace-name ../src/opencv_manual.cpp:8: error: expected namespace-name before ';' token ../src/opencv_manual.cpp: In static member function 'static v8::Handlev8::Value opencvjs::JOpenCV::discardMats(const v8::Arguments&)': ../src/opencv_manual.cpp:21: error: 'cv' was not declared in this scope ../src/opencv_manual.cpp:21: error: template argument 1 is invalid ../src/opencv_manual.cpp:23: error: 'cv' is not a class or namespace ../src/opencv_manual.cpp:23: error: 'ptr' was not declared in this scope ../src/opencv_manual.cpp:23: error: 'cv' cannot appear in a constant-expression ../src/opencv_manual.cpp:23: error: template argument 1 is invalid ../src/opencv_manual.cpp:25: error: type '' argument given to 'delete', expected pointer ../src/opencv_manual.cpp:30: error: 'cv' was not declared in this scope ../src/opencv_manual.cpp:30: error: template argument 1 is invalid ../src/opencv_manual.cpp:32: error: 'cv' is not a class or namespace ../src/opencv_manual.cpp:32: error: 'ptr' was not declared in this scope ../src/opencv_manual.cpp:32: error: 'cv' cannot appear in a constant-expression ../src/opencv_manual.cpp:32: error: template argument 1 is invalid ../src/opencv_manual.cpp:34: error: type '' argument given to 'delete', expected pointer ../src/opencv_manual.cpp: In static member function 'static v8::Handlev8::Value opencvjs::JOpenCV::cvSmooth(const v8::Arguments&)': ../src/opencv_manual.cpp:46: error: 'cv' has not been declared ../src/opencv_manual.cpp:46: error: 'src' was not declared in this scope ../src/opencv_manual.cpp:46: error: 'cv' was not declared in this scope ../src/opencv_manual.cpp:46: error: template argument 1 is invalid ../src/opencv_manual.cpp:47: error: 'cv' is not a class or namespace ../src/opencv_manual.cpp:47: error: 'dst' was not declared in this scope ../src/opencv_manual.cpp:47: error: 'cv' cannot appear in a constant-expression ../src/opencv_manual.cpp:47: error: template argument 1 is invalid ../src/opencv_manual.cpp:48: error: 'CV_GAUSSIAN' was not declared in this scope ../src/opencv_manual.cpp:54: error: 'CvMat' was not declared in this scope ../src/opencv_manual.cpp:54: error: expected ';' before 'cvSrc' ../src/opencv_manual.cpp:55: error: expected ';' before 'cvDst' ../src/opencv_manual.cpp:57: error: '::cvSmooth' has not been declared ../src/opencv_manual.cpp:57: error: 'cvSrc' was not declared in this scope ../src/opencv_manual.cpp:57: error: 'cvDst' was not declared in this scope ../src/opencvjs.h: At global scope: ../src/opencvjs.h:221: warning: 'void opencvjs::ExposeConstants(v8::Handlev8::Object)' declared 'static' but never defined make: *\ [Release/obj.target/addon/src/opencv_manual.o] Error 1 make: Leaving directory /var/www/canvasGenerator/node_modules/opencv-node/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/root/nvm/v0.8.11/lib/node_modules/node-gyp/lib/build.js:236:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:96:17) gyp ERR! stack at Process._handle.onexit (child_process.js:678:10) gyp ERR! System Linux 2.6.32-5-amd64 gyp ERR! command "node" "/root/nvm/v0.8.11/bin/node-gyp" "install" "build" gyp ERR! cwd /var/www/canvasGenerator/node_modules/opencv-node gyp ERR! node -v v0.8.11 gyp ERR! node-gyp -v v0.7.1 gyp ERR! not ok

Also, with the bea tool i successfully launch the compile.sh script.

Do you have an idea ?

codeboost commented 11 years ago

It looks like opencv is not installed on your server. If you have Ubuntu, try sudo apt-get install opencv or sudo apt-get install libopencv-dev

Otherwise, try looking up in the OpenCV documentation how to install it for your own distribution. You do not need bea to install opencv-node --> it's a tool used to generate C++ files.

morgangiraud commented 11 years ago

Well, it was just a problem of library link ...

Reminder for myself : when having opencv from src in a custom repo don't forget to add this export PKG_CONFIG_PATH=/.../opencv/include/opencv/