Ask Your Question

Error C2015

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

patrick129 gravatar image

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

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;;
        imshow('video', frame);

        if (waitKey(30) == 's')
    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

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

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


@berak THANK YOU SO MUCH I've fixed this

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

Question Tools

1 follower


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

Seen: 86 times

Last updated: Oct 09 '19