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 9289967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:18:21+00:00 2026-06-18T20:18:21+00:00

I am trying to develop a stereoscopic vision system. I am receiving the messages

  • 0

I am trying to develop a stereoscopic vision system. I am receiving the messages below whenever I try to build my code:

   ***** Build of configuration Debug for project RicoCameraCpp ****

    make all 
    Building file: ../main.cpp
    Invoking: Cross G++ Compiler
    g++ -I/home/ux/Downloads -I/usr/local/boost_1_52_0/boost -I/usr/local/boost_1_52_0 -    I/home/ux/Downloads/opencv2 -include/home/ux/Downloads/opencv2/opencv_modules.hpp -include/usr/local/boost_1_52_0/boost/thread.hpp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
In file included from /usr/local/boost_1_52_0/boost/thread/thread.hpp:22:0,
                 from /usr/local/boost_1_52_0/boost/thread.hpp:13,
                 from <command-line>:0:
/usr/local/boost_1_52_0/boost/thread/detail/thread.hpp: In member function ‘void boost::detail::thread_data<F>::run() [with F = int (*)(int, char**)]’:
../main.cpp:81:1:   instantiated from here
    /usr/local/boost_1_52_0/boost/thread/detail/thread.hpp:78:17: error: too few arguments to function
    /usr/local/boost_1_52_0/boost/system/error_code.hpp: At global scope:
    /usr/local/boost_1_52_0/boost/system/error_code.hpp:214:36: warning: ‘boost::system::posix_category’ defined but not used [-Wunused-variable]
    /usr/local/boost_1_52_0/boost/system/error_code.hpp:215:36: warning:     ‘boost::system::errno_ecat’ defined but not used [-Wunused-variable]
    /usr/local/boost_1_52_0/boost/system/error_code.hpp:216:36: warning:     ‘boost::system::native_ecat’ defined but not used [-Wunused-variable]
    make: *** [main.o] Error 1

    **** Build Finished *****

Here’s my code:

#include "cstdlib"
#include "cmath"
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include "boost/thread.hpp"
#include <iostream>

using namespace std;
using namespace boost;
using namespace cv;

int firstCam( int argc, char** argv )
{
    //initilize first camera
    CvCapture* captureRightCam = cvCaptureFromCAM(0);

    //check if first camera is available
    if(!captureRightCam)
        {
        cout << "No first camera to capture\n";
            return(-1);
        }

    //create right window
    cvNamedWindow( "Right Cam", CV_WINDOW_AUTOSIZE );

    //display frames for every cvWaitKey duration
    while ( 1 )
        {
            //get frames
        IplImage* rightFrame = cvQueryFrame( captureRightCam );

        //check if captured
        if ( !rightFrame )
        {
            fprintf( stderr, "ERROR: frame is null...\n" );
            getchar();
            break;
        }
        //show frames inside the windows
        cvShowImage( "Right Cam", rightFrame );
        cvWaitKey(150);
    }
//release and destroy windows
cvReleaseCapture( &captureRightCam );
cvDestroyWindow( "Right Cam" );
return 0;
}

int secondCam( int argc, char** argv )
{
CvCapture* captureLeftCam = cvCaptureFromCAM(1);
if(!captureLeftCam)
    {
        cout << "No second camera to capture\n";
        return(-1);
    }
cvNamedWindow( "Left Cam", CV_WINDOW_AUTOSIZE );
while ( 1 )
    {
        IplImage* leftFrame = cvQueryFrame( captureLeftCam );
        if ( !leftFrame )
        {
            fprintf( stderr, "ERROR: frame is null...\n" );
            getchar();
            break;
        }
        cvShowImage( "Left Cam", leftFrame );
        cvWaitKey(150);
    }
cvReleaseCapture( &captureLeftCam );
cvDestroyWindow( "Left Cam" );
return 0;
}

int main()
{
boost::thread t1(firstCam);
boost::thread t2(secondCam);
return 0;
}

What am I doing wrong?

  • 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-06-18T20:18:22+00:00Added an answer on June 18, 2026 at 8:18 pm

    I think the error message is very descriptive, actually:

    You are trying to make a thread out of your function firstCam. That function takes two arguments, but when you create your thread, you don’t give it any arguments. It therefore can’t figure out what arguments to pass to your function and therefore complains about “too few arguments”.

    In this case, it seems that you copied the function signatures from somewhere without giving it any thought. You never use argc and argv at all.

    (As a side note:

    using namespace std;
    using namespace boost;
    using namespace cv;
    

    is a bad idea and will get you into trouble sooner or later. See GotW 53 for details.)

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

Sidebar

Related Questions

I am trying develop a basic referrer system to my Django website, system will
Trying to develop a text editor, I've got two textboxes, and a button below
I'm trying to develop a system service, so I use the echo service as
I'm trying to develop a feed for an intranet document management system, so that
I am trying to develop an inventory and point of sale system for a
Im trying to develop a simple java code which will upload some contents from
we are trying to develop a web application framework and build implementatins on top
I'm trying to develop a shell in Linux as an Operating Systems project. One
Im trying to develop service that starts by bootup receiver if the wifi or
Im trying to develop my first ASP.NET MVC web app and have run into

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.