Ask Your Question
0

Error C2015

asked 2019-10-09 03:19:05 -0600

patrick129 gravatar image

updated 2019-10-09 03:20:24 -0600

berak gravatar image

Hi I have a question again: I'm writing program for capturing video from my camera in Opencv and this is the program:

#include "opencv2/opencv.hpp"
using namespace cv;

int main(int, char**)
{
    VideoCapture cap(0);

    if (!cap.isOpened())
        return -1;
    while (1)
    {
        Mat frame;
        cap.read(frame);
        imshow('video', frame);

        if (waitKey(30) == 's')
        {
            break;
        }
    }
    return 0;
}

But when i compile this program i've got the error on "imshow('video', frame); It's Error C2015:too many characters in constant How can i fix this? Thank you so much

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-10-09 03:22:02 -0600

berak gravatar image

you're using c++, not python, thus you have to use "" to escape strings, not ''.

imshow("video", frame);

is probably, what you wanted.

edit flag offensive delete link more

Comments

@berak THANK YOU SO MUCH I've fixed this

patrick129 gravatar imagepatrick129 ( 2019-10-09 03:24:13 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-10-09 03:19:05 -0600

Seen: 228 times

Last updated: Oct 09 '19