Compiling Tutorial: error: ‘import’ does not name a type

asked 2014-10-05 00:37:17 -0600

maxdoom gravatar image

Hi there,

my compiler complains that the imports in the following tutorial aren't correct: http://docs.opencv.org/trunk/doc/py_tutorials/py_gui/py_video_display/py_video_display.html

I compiled with g++, or is this a different kind of code? g++ pkg-config --cflags --libs opencv test.cpp -o test

The Massage: test.cpp:14:16: warning: character constant too long for its type [enabled by default] test.cpp:1:1: error: ‘import’ does not name a type

I was wondering what to do to compile it. Thanks in advance.

edit retag flag offensive close merge delete

Comments

1

you are trying to compile a python script ? ;) hehe, no.

to run those, it's like

python [scriptname] [args...]

again, - no, that is not c++, but python, another language.

berak gravatar imageberak ( 2014-10-05 00:44:35 -0600 )edit

Thanks for the information. I used you command and it worked. Since I don't know about python I didn't recognized it.

maxdoom gravatar imagemaxdoom ( 2014-10-05 13:04:33 -0600 )edit