Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

cvSaveImage error

smitavnair
Beginner
731 Views
Hello !!
Trying to execute an openCV code saved with extention ".c" . Gives me the following error when I try to save an image .

too few arguments in function call
cvSaveImage(name,img2)

The same program if saved in " .cpp" , there is no error !!

Kindly help
0 Kudos
1 Reply
PaulF_IntelCorp
Employee
731 Views

I'm not expert with OpenCV, so I'm speculating, but I think the issue has nothing to do with OpenCV or IPP and is due to a difference between what C++ allows and C allows when making a function call. By saving a file as .C that was written as .CPP you are asking the compiler to compile your code according to C language conventions. C++ handles "default parameters" in functions differently than C.

I suspect that if you look at the full definition of your problem function you'll find that it requires more parameters than you are providing, which C++ will handle by "automagically" inserting some default values for the missing parameters (if the function is so defined); but C will complain about this because not all the parameters have been provided for the function call, because it does not have a concept of "default parameters," only "variable parameter lists," which are quite different.
0 Kudos
Reply