Hello,
I am having a few problems with my image class using OpenCV.
I am getting the errors:
src/image.cpp: In constructor ‘Image<T>::Image(const char*, bool)’:
src/image.cpp:21: error: there are no arguments to ‘cvLoadImage’ that depend on a template parameter, so a declaration of ‘cvLoadImage’ must be available
src/image.cpp:21: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
src/image.cpp:23: error: there are no arguments to ‘cvLoadImage’ that depend on a template parameter, so a declaration of ‘cvLoadImage’ must be available
src/image.cpp: In member function ‘void Image<T>::save(const char*)’:
src/image.cpp:44: error: there are no arguments to ‘cvSaveImage’ that depend on a template parameter, so a declaration of ‘cvSaveImage’ must be available
The header file is pretty standard, including cv.h for the required functions.
Code snippets below, with full files attached (image.hpp renamed to image.h otherwise it would not allow upload):
image.cpp Lines 18-25:
template<class T>
Image<T>::Image(const char* filename, bool color = true) {
if(color) {
imgp = cvLoadImage(filename);
} else {
imgp = cvLoadImage(filename,0);
}
}
image.cpp Lines 42-45:
template<class T>
void Image<T>::save(const char* filename) {
cvSaveImage(filename, imgp);
}
Thanks alot for any help :)
Adam