- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page