Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4107650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:32:38+00:00 2026-05-20T21:32:38+00:00

I am using VS2010 on a C++ project using opencv. Many of the calls

  • 0

I am using VS2010 on a C++ project using opencv. Many of the calls in opencv have default parameters for the last few parameters to functions. However, when omitting these parameters in function calls, Visual Studio complains and says "functionname: too few arguments for call

Is this a quirk of visual studio? Is it a setting somewhere that I can turn off? Why is this occurring. The code compiles fine under g++.

edit

As an example,

#include <cv.h>
#include <cxcore.h>

int main()
{

    CvMat *rotation_vector = cvCreateMat(3,3, CV_64FC1);
    double rotation[] = { 0, 1, 0,
                -1, 0, 0,
                0, 0, 1 };

    cvInitMatHeader(rotation_vector, 3, 3, CV_64FC1, rotation, 2147483647); // works
        cvInitMatHeader(rotation_vector, 3, 3, CV_64FC1, rotation); // doesn't work
    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:32:38+00:00Added an answer on May 20, 2026 at 9:32 pm

    The declaration for cvInitMatHeader() is this:

    CVAPI(CvMat*) cvInitMatHeader( CvMat* mat, int rows, int cols, int type,
        void* data CV_DEFAULT(NULL), int step CV_DEFAULT(CV_AUTOSTEP) ); 
    

    The definition of CV_DEFAULT looks something like this:

    #ifdef __cplusplus
        #define CV_DEFAULT(val) = val
    #else
        #define CV_DEFAULT(val)
    #endif
    

    So it appears that your Visual C++ compiler is actually compiling in C mode and not C++ mode. In C mode, __cplusplus would not be defined, so CV_DEFAULT expands to nothing. Therefore, it appears that the function declaration does not have default parameters.

    Check your project settings and make sure you’re compiling the code in C++ mode. That is, ensure that the /Tp or /TP compiler switch is enabled. You should also make sure your C++ files have the .cpp file extension.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've begun using ReSharper and really enjoy it. However I have a project which
I am using VS2010 and I have a C++ project that is referencing and
I am doing a project with VS2010 using C#. I have a local database
I have a standard sql server 2008 project which has been created using vs2010.
I'm working on an ASP.NET web project using VS2010/C#, I have some text boxes
I am using VS2010 premium, and I have a database project in my solution.
I have a .net project using a crystal report. I am using VS2010 and
I'm using VS2010 with Resharper 5.1. I have two projects, a library project (Lib)
I have just created a new project in VS2010 using the Visual c# >
I'm using VS2010 Beta 2, I have a Complex Type called Address with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.