problem to execute on linux

Sysprogs forums Forums VisualGDB problem to execute on linux

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6508
    hossein
    Participant

    hi,
    i’m using visualgdb(trial) to build a program in visual studio for linux. i work with vs2010 and my remote machine is raspberry pi 2(raspbian installed). the program compiled built and linked successfully and i could run and debug it in vs2010. ​
    the reason i decide to use visualgdb was to make executable application for linux. because i have never exprienced linux before. so i found the executable file that visualgdb produced on remote and try to run it and i got these errors:

    /dev/video0 does not support memory mapping
    munmap: Invalid argument​​​
    unable to stop the stream .:bad file descriptor
    highgui error: v4l: could not sync to video stream. inappropriate ioctl for device
    segmentation​​​ fault

    is there any solution?
    the errors are the same for debug and release version
    ​​​​
    and this is my code:

    #include “opencv2/opencv.hpp”

    using namespace cv;
    using namespace std;

    int main(int, char**)
    {

    VideoCapture cap(0); // open the default camera

    if(!cap.isOpened())
    {// check if we succeeded
    cout<<“dashskgdklggkagdsa”;
    waitKey(2000);
    return -1;
    }
    double sec;
    Mat edges;
    Mat frame;
    //vector<Vec4i> lines;
    cap >> frame;
    double test = cap.get(CV_CAP_PROP_FRAME_WIDTH);
    cap.set(CV_CAP_PROP_FRAME_WIDTH,800);
    cap.set(CV_CAP_PROP_FRAME_HEIGHT,600);

    double fps;
    namedWindow(“lines”,WINDOW_AUTOSIZE);
    namedWindow(“orig”,WINDOW_AUTOSIZE);
    for(;;)
    {
    cap >> frame; // get a new frame from camera
    Mat gray(frame.rows,frame.cols,CV_8UC1);
    //video.write(frame);
    // imwrite(“test.bmp”,frame);
    Mat r;

    cvtColor(frame, gray, CV_BGR2GRAY);

    imshow(“orig”, frame);
    imshow(“lines”,gray);

    if(waitKey(1)>0)
    {
    break;
    }
    }
    return 0;
    }​​​​

    #6515
    ket
    Participant

    Hi,

    Are you running the executable on the same raspberry pi 2 device or on another rasperry pi or Linux remote machine?

    As the executable was built for a rasperry pi 2 device running raspian other Linux machines have different hardware and libraries and then the program cannot run there.

    #6561
    hossein
    Participant

    sorry for late reply, my hardware wrecked due to sd card corruption and i was busy with that.

    i succeeded to run the program, the problem solved when i ran it from command line(instead of clicking on it and choosing execute in terminal).

    i added two more line to extract canny edges and that worked too. then i try to add trackbar to control canny parameters but i faced the same problem. it works nice in vs2010 in local computer but on the raspberry pi 2 i have this errors:

    HIGHGUI ERROR: V4L: Property <unknown property string>(6) not supported by device

    (lines:2929): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised
    Segmentation fault

     

     

    #6569
    hossein
    Participant

    any idea?

    is there anyone working with raspberry pi?

    #6576
    support
    Keymaster

    Hi,

    It looks like some sort of an incompatibility problem between your device and your toolchain. Please double-check the following:

    • Ensure that your toolchain is compatible with the image version on your Raspberry Pi
    • Ensure that you have re-synchronized the sysroot of your toolchain with the device

    If nothing helps, please try compiling your program directly on Raspberry Pi and let us know if that works.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.