diff --git a/src/OpenCV.cc b/src/OpenCV.cc index fe791a6..37b886f 100755 --- a/src/OpenCV.cc +++ b/src/OpenCV.cc @@ -71,7 +71,8 @@ OpenCV::ReadImage(const Arguments &args) { return Undefined(); } catch( cv::Exception& e ){ - return v8::ThrowException(v8::Exception::Error(v8::String::New("OpenCV Error"))); + const char* err_msg = e.what(); + return v8::ThrowException(v8::Exception::Error(v8::String::New(err_msg))); } }; diff --git a/src/OpenCV.h b/src/OpenCV.h index 8527765..10bb32a 100755 --- a/src/OpenCV.h +++ b/src/OpenCV.h @@ -1,6 +1,10 @@ #ifndef __NODE_OPENCV_H__ #define __NODE_OPENCV_H__ +#ifdef __cplusplus + #import "opencv2/opencv.hpp" +#endif + #include #include #include @@ -10,7 +14,6 @@ #include #include - using namespace v8; using namespace node; diff --git a/src/init.cc b/src/init.cc index 1627e5b..b4ea110 100755 --- a/src/init.cc +++ b/src/init.cc @@ -1,7 +1,3 @@ -#ifdef __cplusplus - #import "opencv2/opencv.hpp" -#endif - #include "OpenCV.h" #include "Point.h" #include "Matrix.h"