OpenCV Installation Troubleshooting Guide

[Revised 2011-08-29. See Change Log section for revision information.]This guide lists solutions for problems you might encounter when installing OpenCV and its dependencies. Many of the problems are related to using webcams. This guide is a companion guide to “A Comprehensive Guide to Installing and Configuring OpenCV 2.3 on Ubuntu,” which can be found on ozbotz.org.The problems are listed in the sequence that they might occur during a typical OpenCV install. If the problem is accompanied by an error message, the relevant part of the message is highlighted in yellow.

Here is a list of error messages that are addressed by this guide:

  • ERROR: libx264 not found
  • undefined reference to ‘x264_encoder_open_116′
  • libv4lconvert-priv.h:25:21: fatal error: jpeglib.h: No such file or directory
  • libv4l1.c:53:28: fatal error: linux/videodev.h: No such file or directory
  • /home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:492:13: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
  • libv4lconvert: warning more framesizes then I can handle!
  • [swscaler @ 0x89c3e30]No accelerated colorspace conversion found from yuv420p to bgr24.
  • error while loading shared libraries: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
  • VIDIOC_DQBUF: Input/output error
  • VIDIOC_QUERYMENU: Invalid argument

 

Problems Building ffmpeg

Problem
<84> .../ffmpeg$ ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
ERROR: libx264 not found

Solution
Use ffmpeg version 0.7.x. This error occurs if you configure ffmpeg version 0.6.x with the options shown above.

 

Problem
<84> .../ffmpeg$ make
LD ffmpeg_g
libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/home/osman/src/ffmpeg/ffmpeg-0.7.3/libavcodec/libx264.c:395: undefined reference to 'x264_encoder_open_116'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
Solution
Rebuild x264 and ffmpeg with the shared library option. To rebuild x264, change to the directory where you untared the x264 source files, and enter the following commands:
./configure --enable-shared --enable-pic
make
sudo make install

To rebuild ffmpeg, change to the directory where you untared the ffmpeg source files, and enter the following commands:

./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared
make
sudo make install

This solution comes from http://www.linuxquestions.org/questions/linux-newbie-8/problem-with-enable-libx264-option-in-ffmpeg-822156/page2.html.

 

Problems Building v4l

Problem
<37> .../v4l-utils-0.8.4 $ make
make -C lib all
make[1]: Entering directory `/home/osman/src/v4l/v4l-utils-0.8.4/lib'
make -C libv4lconvert all
make[2]: Entering directory `/home/osman/src/v4l/v4l-utils-0.8.4/lib/libv4lconvert'
cc -Wp,-MMD,"libv4lconvert.d",-MQ,"libv4lconvert.o",-MP -c -I../include -fvisibility=hidden -fPIC -DLIBDIR=\"/usr/local/lib\" -DLIBSUBDIR=\"libv4l\" -I../../include -I../../lib/include -D_GNU_SOURCE -DV4L_UTILS_VERSION='"0.8.4"' -g -O1 -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -o libv4lconvert.o libv4lconvert.c
In file included from libv4lconvert.c:26:0:
libv4lconvert-priv.h:25:21: fatal error: jpeglib.h: No such file or directory compilation terminated.
make[2]: *** [libv4lconvert.o] Error 1
Solution
Install libjpeg. See “A Comprehensive Guide to Installing and Configuring OpenCV 2.3 on Ubuntu.”

 

Problem
<37> .../v4l-utils-0.8.4 $ make
...
cc -Wp,-MMD,"libv4l1.d",-MQ,"libv4l1.o",-MP -c -I../include -fvisibility=hidden -fPIC -I../../include -D_GNU_SOURCE -g -O1 -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -o libv4l1.o libv4l1.c
libv4l1.c:53:28: fatal error: linux/videodev.h: No such file or directory
compilation terminated.
make[2]: *** [libv4l1.o] Error 1

Solution
Use v4l-utils-0.8.4 or later. This problem occurs when trying to compile an old version of v4l in Ubuntu 11.x. I have not seen this problem on Ubuntu 10.x.

 

Problems Building OpenCV

Problem
Make fails at around 30% with an error building cap_ffmeg.o. This error might look like this:
[ 29%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o
In file included from /home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg.cpp:45:0:
/home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::reopen()’:

/home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:492:13: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
...
/home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:828:10: error: ‘AVERROR_NUMEXPECTED’ was not declared in this scope
/home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:832:10: error: ‘AVERROR_NOFMT’ was not declared in this scope
/home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:834:10: error: ‘AVERROR_IO’ was not declared in this scope
/home/osman/src/opencv/OpenCV-2.3.0/modules/highgui/src/cap_ffmpeg_impl.hpp:836:10: error: ‘AVERROR_NOMEM’ was not declared in this scope

Solution
Install ffmpeg version 0.7.x. You are probably have version 0.8.x installed, which is not compatible with OpenCV 2.3.

 

Problems running a program using OpenCV libraries

Problem
$ ./my_webcam_program
libv4lconvert: warning more framesizes then I can handle!

Solution
Install v4l version 0.8.4 or later, and then run sudo ldconfig. Rerun your program; the message should go away. Note: I don’t really know in what version of v4l this was fixed, but I do know that it is fixed in version 0.8.4.

 

Problem
$ ./my_webcam_program
[swscaler @ 0x89c3e30]No accelerated colorspace conversion found from yuv420p to bgr24.
[swscaler @ 0x8893810]No accelerated colorspace conversion found from yuv420p to bgr24.
[swscaler @ 0x889c5b0]No accelerated colorspace conversion found from yuv420p to bgr24.
Last message repeated 1 times

Solution
The “accepted” solution is to rebuild x264 and ffmpeg with the shared library option. To rebuild x264, change to the directory where you untared the x264 source files, and enter the following commands:
./configure --enable-shared --enable-pic
make
sudo make install

To rebuild ffmpeg, change to the directory where you untared the ffmpeg source files, and enter the following commands:./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared
make
sudo make install

After rebuilding x264 and ffmpeg, you do not need to rebuild OpenCV. If the swscaler message still occurs when you run your program, run sudo ldconfig, and run your program again.

This solution comes from the following thread on ubuntuforums.org: http://ubuntuforums.org/showthread.php?t=1471616

Unfortunately for me, configuring and recompiling x264 and ffmpeg does not make the warning meesage go away. If try the solution above, please let me know in the comments if it works for you.

 

Problem
$ ./my_webcam_program
error while loading shared libraries: libopencv_core.so.2.3: cannot open shared object file: No such file or directory

Solutions (choose one)
1. Complete the “Configure Linux” step of the guide “A Comprehensive Guide to Installing and Configuring OpenCV 2.3 on Ubuntu.”
2. Set your LD_LIBRARY_PATHenvironment variable, as shown in the following example:export LD_LIBRARY_PATH=/usr/local/libReplace /usr/local/lib with the path where the OpenCV libraries are installed on your system.

 

Problem
VIDIOC_DQBUF: Input/output error
libv4l2: error converting / decoding frame data: v4l-convert: libjpeg error: Start Of Frame 0xc0: width=640, height=480, components=175
VIDIOC_DQBUF: Input/output error
libv4l2: error converting / decoding frame data: v4l-convert: libjpeg error: End Of Image

Solution
Make sure that your webcam is connected to a high-speed USB 2.0 port. I have seen this problem occur when my webcam was connected to a slower full-speed USB port.

 

Problem
<19> .../test1 $ ./my_webcam_program
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument

Solution
I have not found a solution to this problem. If you know a solution, please let me know! The message is coming from v4l. The message occurs when a webcam is initialized. I think that my webcam, a Logitech C910, does not conform to the UVC specification, and v4l has trouble querying the parameters of the webcam. I can still get frames from the webcam, so I just ignore the message.

 

Change Log

  • 2011-08-29 Added solution for ffmpeg make error undefined reference to 'x264_encoder_open_116'

 

References

47 comments to OpenCV Installation Troubleshooting Guide

  • Hi. I installed Kubuntu 11.10 on my laptop yesterday and, while compiling OpenCV-2.3.1, I got the error related to the building of the file modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o:
    ‘CODEC_TYPE_VIDEO’ was not declared in this scope

    But I don’t have FFMPEG 0.8.x installed. The command `apt-cache show ffmpeg` reports version 4:0.7.2-1ubuntu1. Maybe this version is problematic too.

    How can I downgrade just the package ffmpeg on my distribution? Or how can I force the CMake search for FFMPEG to find another version installed on my system? If you search for “ffmpeg” along CMakeLists variables, you find only WITH_FFMPEG, not a variable to set the path to some library.

    I think the best solution should be maintain the version 0.7.2 that comes with Kubuntu 11.10 while instaling an older version of FFMPEG for use with OpenCV-2.3.1 only, but I don’t know how to do this yet.

    Any help?

    Thans in advance.

    • Osman Eralp

      > I think the best solution should be maintain the version 0.7.2
      > that comes with Kubuntu 11.10 while instaling an older version
      > of FFMPEG for use with OpenCV-2.3.1 only…

      0.7.2 is the older version! You should try a newer version: 0.8.x. Good combinations are OpenCV-2.3.1+ffmpeg-0.8.x and OpenCV-2.3+ffmpeg-0.7.x. I would first verify that you have OpenCV-2.3.1 installed. Create the following small program:

      $ more osman.c
      #include "cvaux.h"
      main() {
      printf ("Running OpenCV version %s (%d.%d.%d)\n", CV_VERSION,
      CV_MAJOR_VERSION, CV_MINOR_VERSION, CV_SUBMINOR_VERSION);
      }
      $ g++ osman.c `pkg-config opencv --cflags --libs` -o osman
      $ ./osman
      Running OpenCV version 2.3.1 (2.3.1)

      If you really do have OpenCV 2.3.1, install ffmpeg 0.8.x, and then delete the OpenCV build directory and compile it again. Let me know how it works.

      • > 0.7.2 is the older version! You should try a newer version: 0.8.x. Good
        > combinations are OpenCV-2.3.1+ffmpeg-0.8.x and OpenCV-2.3+ffmpeg-0.7.x.

        Ops! So, we have a problem in the solution for this error. It’s written in the tutorial:
        > Solution
        > Install ffmpeg version 0.7.x. You are probably have version 0.8.x installed, which
        > is not compatible with OpenCV 2.3.

        Then I thought OpenCV was needing an older version, not a newer one.

        Sorry, I haven’t seen the main thread of the tutorial. I started to follow the steps described there and, after downloading and installing FFMPEG 0.8.5, the compilation of OpenCV was successfull, reaching 100% of the build. Thank you very much for the tutorial, Osman.

        Unfortunately, getting OpenCV-2.3.1 compiled and running on my new system didn’t solve all my problems: I’m trying to get depth maps with a Kinect device. I tried to run the sample (distributed with OpenCV in OpenCV-2.3.1/samples/cpp/kinect_maps.cpp) and I followed the instructions at the document OpenCV-2.3.1/doc/opencv_user.pdf. OpenNI library and PrimeSense drivers were correctly identified by CMake when building OpenCV.

        The problem is that, when I try to get a depth map, its returned the texture of the scene. In other words, I am accessing just the camera of kinect, not the depth generator. The error that I’m getting is:
        HIGHGUI ERROR: V4L: Property (2147483748) not supported by device
        HIGHGUI ERROR: V4L2: Unable to get property (2147483653) – Argumento inválido
        HIGHGUI ERROR: V4L: Property (0) not supported by device

        But this seems to be a topic too specific to this discussion. Anyway, if someone have already solved this problem, I would appreciate a little help.

  • Thanks, Osman.

    After some tips from HomeBrew Robotics Club, I got my system working with OpenCV and OpenGL accessig RGB and depth images from kinect.

    I made a downgrade of my distribution from Kubuntu 11.10 to Kubuntu 11.04, compiled OpenCV 2.3.1 with OpenNI and PrimeSense drivers and also compiled the libfreenect library, from OpenKinect project (http://openkinect.org/wiki/Main_Page). Everything is working now.

    Thank you, again.

  • Hi:
    When I was installing OpenCv-2.3.1, The system installed only 34 %, and then presented:

    /usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet’ can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/libavcodec.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make[2]: *** [lib/libopencv_highgui.so.2.3.1] Error 1
    make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
    make: *** [all] Error 2

    Can you give me any help?

  • Hi Osman,

    The messages: ‘VIDIOC_QUERYMENU: Invalid argument’ come from opencv cap_libv4l.cpp
    file.
    The ‘querymenu.id” value still has the “V4L2_CTRL_FLAG_NEXT_CTRL” set when enumerating
    the menu items.
    Following patch solves this:

    — OpenCV-2.3.1/modules/highgui/src/cap_libv4l.cpp 2011-09-12 20:41:29.000000000 +0200
    +++ opencv/modules/highgui/src/cap_libv4l.cpp 2011-12-01 19:00:37.503761631 +0100
    @@ -489,7 +489,7 @@
    {
    // printf (” Menu items:\n”);
    CLEAR (capture->querymenu);
    - capture->querymenu.id = capture->queryctrl.id;
    + capture->querymenu.id = capture->queryctrl.id & ~V4L2_CTRL_FLAG_NEXT_CTRL;
    for (capture->querymenu.index = capture->queryctrl.minimum;
    (int)capture->querymenu.index queryctrl.maximum;
    capture->querymenu.index++)

    Note that you can still get some of these messages when the menu item is not supported
    by the driver.

    Greetz,

    Hans

    • Osman Eralp

      Thanks for the info! Did you create this patch? If so, will you request that it be added to the next release?

  • arun

    Hi,

    I am a beginner to ubuntu and opencv when i try to install x264-snapshot-20111214-2245-stable

    by ./configure –enable-static –enable-shared
    –enable-pic

    fatal: Not a git repository (or any of the parent directories): .git

    Thanks in advance,

    Arun

    • Osman Eralp

      It is strange that you are getting a “git” error message when running configure. git is a program that is used to fetch source code. git is unrelated to installing x264.
      1. Did you follow the procedure to install x264 as described in my other guide here: http://ozbots.org/opencv-installation/ ?
      2. Can you please cut and paste the exact command and output from the terminal so I can see the error inc ontext?

  • thought i could contribute one additional error & fix for this post:
    the error ‘QMainWindow: No such file or directory’ was encountered during the installation of v4l prior to the opencv installations.
    to fix: sudo apt-get install libqt4-dev

  • Weber

    Hi,

    I’ve followed the article about installing, and successfully build and ran the opencv 2.3 examples. However, I can’t compile a simple code:

    #include “highgui.h”
    #include “cv.h”
    int main( int argc, char** argv )
    {
    IplImage* img = cvLoadImage( argv[1] );
    cvNamedWindow( “Example1″, CV_WINDOW_AUTOSIZE );
    cvShowImage( “Example1″, img );
    cvWaitKey(0);
    cvReleaseImage( &img );
    cvDestroyWindow( “Example1″ );
    }

    Command:

    g++ -ggdb `pkg-config opencv –cflags –libs` –library opencv cv1.c -o cv1

    Response:

    /tmp/ccxlp7oU.o: In function `main’:
    /home/weber/Documents/opencv/testes/1/cv1.c:5: undefined reference to `cvLoadImage’
    /home/weber/Documents/opencv/testes/1/cv1.c:6: undefined reference to `cvNamedWindow’
    /home/weber/Documents/opencv/testes/1/cv1.c:7: undefined reference to `cvShowImage’
    /home/weber/Documents/opencv/testes/1/cv1.c:8: undefined reference to `cvWaitKey’
    /home/weber/Documents/opencv/testes/1/cv1.c:9: undefined reference to `cvReleaseImage’
    /home/weber/Documents/opencv/testes/1/cv1.c:10: undefined reference to `cvDestroyWindow’
    collect2: ld returned 1 exit status

    Anyone can help?

    • Osman Eralp

      I was able to compile your code with no issues. What is the output of the following command?

      <22> …/test1 $ pkg-config opencv –cflags –libs
      -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

      • ali.omar

        I followed your guide, x264(x264-snapshot-20120302-2245-stable.tar.bz2) and ffmpeg(0.10) are the latest versions (older versions result in opencv2.3.1 not compiling). I am running precise. This is my code:

        #include

        using namespace cv;

        int main ( int argc, char **argv )
        {
        namedWindow(“the test window”);
        return 0;
        }

        I used the following terminal command:
        g++ `pkg-config opencv –cflags` `pkg-config opencv –libs` main.cpp -o my_code

        and the result was:
        /tmp/ccYKWdxZ.o: In function `main’:
        main.cpp:(.text+0x3e): undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits, std::allocator > const&, int)’
        collect2: ld returned 1 exit status

      • ali.omar

        I followed your guide, x264(x264-snapshot-20120302-2245-stable.tar.bz2) and ffmpeg(0.10) are the latest versions (older versions result in opencv2.3.1 not compiling). I am running precise. This is my code:

        #include

        using namespace cv;

        int main ( int argc, char **argv )
        {
        namedWindow(“the test window”);
        return 0;
        }

        I used the following terminal command:
        g++ `pkg-config opencv –cflags` `pkg-config opencv –libs` main.cpp -o my_code

        and the result was:

        /tmp/ccYKWdxZ.o: In function `main’:
        main.cpp:(.text+0x3e): undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits, std::allocator > const&, int)’
        collect2: ld returned 1 exit status

        I used command you suggested:

        pkg-config opencv –cflags –libs -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

        and the output was:

        -I/usr/local/include/opencv: unknown option

  • I have ubuntu 10.10….
    I want ffmpeg with Opencv2.3.1 support….
    I did the installation many times before….with building ffmpeg manually as you said….
    Its working fine also its showing me ffmpeg support ON at the time of configuring OpenCv 2.3.1…
    But when I use CV_FOURCC(‘F’,’L’,’V’,’1′) to create .flv file through cvCreateVideoWriter I am getting this error [flv @ 0x9bf5000] Tag FLV1/0x31564c46 incompatible with output codec id ’22′….
    Is their any thing wrong I had done while installation….

    • Osman Eralp

      I also have Ubuntu 10.10 and OpenCV 2.3.1. I do not get the error you mention. If you send me your code, I will try to compile it on my system.

  • Bill

    Hi,

    Whenever I attempt to display any video on OpenCV using cvCreateFileCapture and cvQueryFrame, I always get this run-time error:

    warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:526)

    I can’t seem to find an acceptable solution to this problem. I would appreciate it so much if you could help me.

    Thanks!

    • Osman Eralp

      Needless to say, you shouldn’t get that error! Did you compile ffmpeg from source? When you ran cmake to configure OpenCV, did it say “FFMPEG: YES”?

    • Yang Liu

      Hi,

      I got the same problem:
      warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:526)

      Have you fixed it already? I’d appreciate it a lot if you can tell me about how you fix the problem.

      Thank you!

  • kimi

    it’s the best tutorial thank you so much Osman, it was really helpful for me.

  • Miquel

    Hello Osman!
    Firstly, thank you so much for the guide. It helps me to solve some problems, but it apeared new problems, so I can’t finish installing OpenCV.

    Doing make, at 34% terminal shows me that problem, ad I didn’t found how to solve. Are there anyone who can help me please?

    Linking CXX executable ../../bin/opencv_test_calib3d
    /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_scaled_font_unlock_face’
    /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_scaled_font_lock_face’
    /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_font_options_substitute’
    /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_font_face_create_for_pattern’
    collect2: ld returned 1 exit status
    make[2]: *** [bin/opencv_test_calib3d] Error 1
    make[1]: *** [modules/calib3d/CMakeFiles/opencv_test_calib3d.dir/all] Error 2
    make: *** [all] Error 2

    • Osman Eralp

      The error refers to the libpangocairo library. If I recall correctly, libpango is used for displaying international text. Try reinstalling libpango and libpangocairo. Did you uninstall another program that used libpango, such as Firefox? Perhaps that other program broke the libpango installation.

  • Cherif

    Hi ! I’ve been going through all possible ways to build opencv 2.3.1 on my Ubunti 10.04 64-bits. I got the problem with the ffmpeg thing (which i didn’t get very well), and i finally found this : http://code.opencv.org/issues/1605
    I replaced everything as it was said and most of my errors (not my warnings :p) are gone, except this new error showing up :

    [ 16%] Built target pch_Generate_opencv_highgui
    [ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o
    In file included from /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:45:
    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:935:1: warning: “/*” within comment
    In file included from /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:45:
    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘void CvCapture_FFMPEG::close()’:

    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::open(const char*)’:
    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:936: error: expected primary-expression before ‘extern’
    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:62: error: a function-definition is not allowed here before ‘{‘ token

    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:250: error: expected ‘}’ at end of input
    /local/home/userlnx/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:250: warning: no return statement in function returning non-void
    make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o] Error 1
    make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
    make: *** [all] Error 2

    • Osman Eralp

      Cherif, I have opencv 2.3.1 running successfully on Ubuntu 10.04, so I know it’s possible! From where did you get ffmpeg? Did you download a tarfile or did you use git or apt-get? What version of ffmpeg did you install?

  • Brian

    I am trying to configure the ffmpeg libraries but i am getting ERROR: libx264 not found when using both 0.8.1 and 0.7.11 so I cannot seem to figure out the problem. Any help woul be very much appreciated.

    • Osman Eralp

      How did you obtain ffmpeg? Did you download a tarfile, or did you use git? Did x264 install without error?

      • Brian

        downloaded the tar and x264 installed without error so I am at a loss

      • Brian

        cd /home/osman
        mkdir src
        cd src
        mv /home/osman/Downloads/x264-snapshot-20110913-2245-stable.tar.bz2 .
        tar xvf x264-snapshot-20110913-2245-stable.tar.bz2
        cd x264-snapshot-20110913-2245-stable

        used this method from one of your old posts for both the x264 and ffmpeg but for ffmpeg i get the same error for both versions

  • Brian

    Did you have any ideas as to a solution?

  • Ramsri Goutham

    Thanks a bunch!!! This was very helpful!

  • Saad

    I am trying to install OpenCV since a week or so, I have tried almost every version and followed most of the installation guide by google, but could not be able to start work on OpenCV.

    My code is

    #include
    #include “/home/saad/saadDesktop/Hiwi/OpenCV-2.1.0/include/opencv/cv.h”
    #include “/home/saad/saadDesktop/Hiwi/OpenCV-2.1.0/include/opencv/highgui.h”

    using namespace std;

    int main()
    {
    IpImage* myimage;

    myimage= cvLoadImage(“/home/saad/lena.jpg”,1);

    cvNameWindow(“smile”,1);
    cvMoveWindow(“smile”, 100, 100);
    cvNameWindow(“smile”, myimage);

    cvWaitKey(0);
    cvDestroyWindow(“smile”);
    cvReleaseImage(&myimage);

    return 0;
    }

    and errors it shows are………..

    test.cpp: In function ‘int main()’:
    test.cpp:9:5: error: ‘IpImage’ was not declared in this scope
    test.cpp:9:14: error: ‘myimage’ was not declared in this scope
    test.cpp:14:27: error: ‘cvNameWindow’ was not declared in this scope

    I am using Ubuntu 12.04 and currently trying to install opencv 2.3.0

    When I followed the link http://masimet.blogspot.de/2008/07/load-display-image-using-opencv.html to get start in OpenCV, there is a need to mention lib files through the editor (I am using code blocks) as mentioned in the link. But when I locate the lib files e.g., locate cvaux.lib, it does not show me any path. Its mean lib files are not present in my current installation of OpenCv.

    Please help me in this scenario as I am stucked because of this error.

    • Osman Eralp

      You code has some critical problems:
      1. The type should be IplImage not IpImage.
      2. The command is cvNamedWindow not cvNameWindow.
      3. The command to display an image is cvShowImage not cvNameWindow.
      4. The includes are nonstandard.

      This code worked for me:

      #include “cv.h”
      #include “highgui.h”

      using namespace std;

      int main()
      {
      IplImage* myimage;

      myimage= cvCreateImage(cvSize(640,480), IPL_DEPTH_8U, 3);
      //myimage= cvLoadImage(“/home/saad/lena.jpg”,1);

      cvNamedWindow(“smile”,1);
      cvMoveWindow(“smile”, 100, 100);
      cvShowImage(“smile”, myimage);

      cvWaitKey(0);
      cvDestroyWindow(“smile”);
      //cvReleaseImage(&myimage);

      return 0;
      }

      Compile it with this command: g++ `pkg-config opencv –cflags` main.cpp -o main `pkg-config opencv –libs`

  • Evgheny

    When I make openCV (all components before where installed by instruction) I have error on 22% of process:

    [ 22%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_stat.cpp.o
    Linking CXX executable ../../bin/opencv_perf_core
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_space’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_free’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_base64_encode’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avpriv_vorbis_parse_frame’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_realloc2′
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_aes_init’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_tree_insert’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_tree_enumerate’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_tree_node_size’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_sha_size’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_base64_decode’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_bitstream_filter_filter’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_adler32_update’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_bitstream_filter_close’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_sha_init’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_tree_find’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_generic_write’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avcodec_register_all’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_size’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_alloc’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_sha_final’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_des_crypt’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_aes_size’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_bitstream_filter_init’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_drain’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avpriv_vorbis_parse_reset’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_rc4_init’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_fifo_generic_read’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `avpriv_vorbis_parse_extradata’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_des_init’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_rc4_crypt’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_aes_crypt’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_des_mac’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_tree_destroy’
    ../../lib/libopencv_highgui.so.2.4.1: undefined reference to `av_sha_update’
    collect2: ld returned 1 exit status
    make[2]: *** [bin/opencv_perf_core] Error 1
    make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
    make: *** [all] Error 2

  • OPencvprob

    I’ve installed opencv, When I use “pkg-config –libs opencv” in terminal I get
    “/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so ”
    rather than ”
    -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -
    lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib
    -lopencv_legacy -lopencv_flann
    do you know what is the problem?

  • sanket kumar

    hey osman did u find any solution for the following problem

    VIDIOC_QUERYMENU: Invalid argument

  • Panda-Beginner

    Hallo,

    I followed your guide to install opencv on Ubuntu 12.10. Writing an application Qt to open a camera stream works fine.

    Now I want to cross compile OpenCV with cmake/codesourcery and copy it to my pandaboard.
    It seems that Cmake “generates” correctly but after “make” I getting this output(last lines of the output):

    ###########################################################
    Linking C static library ../lib/liblibpng.a
    [ 22%] Built target libpng
    Scanning dependencies of target opencv_core
    [ 22%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o
    cc1plus: warning: include location “/usr/include/eigen2″ is unsafe for cross-compilation [-Wpoison-system-directories]
    In file included from /home/martin/Downloads/OpenCV-2.4.2_arm/OpenCV-2.4.2/modules/core/src/precomp.hpp:52:0,
    from /home/martin/Downloads/OpenCV-2.4.2_arm/OpenCV-2.4.2/modules/core/src/array.cpp:49:
    /home/martin/Downloads/OpenCV-2.4.2_arm/OpenCV-2.4.2/modules/core/include/opencv2/core/internal.hpp:147:30: fatal error: tbb/tbb_stddef.h: No such file or directory
    compilation terminated.
    make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o] Error 1
    make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
    make: *** [all] Error 2

    ###########################################################

    using:
    CMake 2.8.9
    Using Qt 4.8.3
    codesourcery: arm-2010.09-50-arm-none-linux-gnueabi

    I’m getting crazy(I followed some Guides/Howtos/Posting but nothing helps), does anybody knows whats going wrong ??

    thanks

    • Osman Eralp

      The message “fatal error: tbb/tbb_stddef.h: No such file or directory compilation terminated” seems to say that your library search path is not specified correctly. I have seen some strange errors like this if I try to build opencv more than once in the same directory. Try removing the build directory, creating a new build dir, and then building opencv again.

      • Panda-Beginner

        Hello,

        thanks for your answer, but this doesn’t help. I was trying it with OpenCV 2.3.1 -> without any success.
        Also disabling Qt/ffmpeg before configuring/generating(cmake) doesn’t help.(similar errors)
        ################################
        [ 38%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.obj
        cc1plus: warning: include location “/usr/include/eigen2″ is unsafe for cross-compilation
        cc1plus: warning: include location “/usr/include/qt4″ is unsafe for cross-compilation
        cc1plus: warning: include location “/usr/include/qt4/QtGui” is unsafe for cross-compilation
        cc1plus: warning: include location “/usr/include/qt4/QtCore” is unsafe for cross-compilation
        In file included from /usr/include/qt4/QtCore/qatomic_arch.h:66:0,
        from /usr/include/qt4/QtCore/qbasicatomic.h:227,
        from /usr/include/qt4/QtCore/qatomic.h:46,
        from /usr/include/qt4/QtCore/qbytearray.h:45,
        from /usr/include/qt4/QtCore/qstring.h:46,
        from /usr/include/qt4/QtCore/qobject.h:48,
        from /usr/include/qt4/QtCore/qabstracteventdispatcher.h:45,
        from /usr/include/qt4/QtCore/QAbstractEventDispatcher:1,
        from /home/martin/Downloads/OPenCV231/OpenCV-2.3.1/modules/highgui/src/window_QT.h:51,
        from /home/martin/Downloads/OPenCV231/OpenCV-2.3.1/modules/highgui/src/window_QT.cpp:44:
        /usr/include/qt4/QtCore/qatomic_i386.h: In destructor ‘QByteArray::~QByteArray()’:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In destructor ‘QString::~QString()’:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In function ‘CvButtonbar* icvFindButtonbarByName(const char*, QBoxLayout*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘CvTrackbar::CvTrackbar(CvWindow*, QString, int*, int, void (*)(int))’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘CvTrackbar::CvTrackbar(CvWindow*, QString, int*, int, void (*)(int, void*), void*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘CvPushButton::CvPushButton(CvButtonbar*, QString, void (*)(int, void*), void*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘CvCheckBox::CvCheckBox(CvButtonbar*, QString, void (*)(int, void*), void*, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘CvRadioButton::CvRadioButton(CvButtonbar*, QString, void (*)(int, void*), void*, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void CvButtonbar::addButton(QString, void (*)(int, void*), void*, int, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In static member function ‘static CvButtonbar* CvWindow::createButtonbar(QString)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘CvWinProperties* CvWindow::createParameterWindow()’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void CvWindow::icvSaveButtonbar(CvButtonbar*, QSettings*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void CvWindow::icvSaveControlPanel()’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void CvWindow::icvLoadButtonbar(CvButtonbar*, QSettings*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘ViewPort::ViewPort(CvWindow*, int, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void CvWindow::displayInfo(QString, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In destructor ‘QMap::~QMap() [with Key = int, T = QtConcurrent::ResultItem]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In destructor ‘QList::~QList() [with T = QWidget*]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void GuiReceiver::displayStatusBar(QString, QString, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void GuiReceiver::displayInfo(QString, QString, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In function ‘CvTrackbar* icvFindTrackbarByName(const char*, const char*, QBoxLayout*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In destructor ‘QVector::~QVector() [with T = QAction*]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In destructor ‘QVector::~QVector() [with T = QShortcut*]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void QVector::realloc(int, int) [with T = QAction*]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In static member function ‘static void CvWindow::addSlider(CvWindow*, QString, int*, int, void (*)(int))’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void GuiReceiver::addSlider(QString, QString, void*, int, void*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In static member function ‘static void CvWindow::addSlider2(CvWindow*, QString, int*, int, void (*)(int, void*), void*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void GuiReceiver::addSlider2(QString, QString, void*, int, void*, void*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void GuiReceiver::addButton(QString, int, int, void*, void*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void QVector::realloc(int, int) [with T = QShortcut*]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In constructor ‘CvWindow::CvWindow(QString, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void GuiReceiver::createWindow(QString, int)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void ViewPort::drawImgRegion(QPainter*)’:
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:120:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        /usr/include/qt4/QtCore/qatomic_i386.h: In member function ‘void QMap::detach_helper() [with Key = int, T = QtConcurrent::ResultItem]‘:
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: error: output number 0 not directly addressable
        /usr/include/qt4/QtCore/qatomic_i386.h:132:29: warning: use of memory input without lvalue in asm operand 2 is deprecated
        make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.obj] Error 1
        make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
        make: *** [all] Error 2

        ################################

        Would it be better to build OpenCV directly on Pandaboard ?

        thanks

        • Osman Eralp

          You say that you disabled Qt, but the errors seem related to Qt, so somehow it’s still in the build process. Does cmake report anything about Qt? The errors show references to qatomic_i386.h, so you must be compiling on an Intel machine. Building on the PandaBoard might resolve these errors. I can’t say for sure, but it’s worth a try.

          • Panda-Beginner

            maybe it’s a silly question, but could it be that I have to use(means installing on host) “qt-everywhere….” and not “Qt Creator 2.5.2 Based on Qt 4.8.2 (32 bit)”?

  • Vijay

    Hey!

    I am trying to install OpenCV using cmake on Windows. I know this page is related to Ubuntu but I couldn’t find any better page to ask the question.

    While installing it reached 33% and gives me an error:

    Linking CXX executable ..\..\bin\opencv_perf_cored.exe
    Info: resolving vtable for cv::_InputArray by linking to __imp___ZTVN2cv11_Input
    ArrayE (auto-import)
    Info: resolving vtable for cv::_OutputArray by linking to __imp___ZTVN2cv12_Outp
    utArrayE (auto-import)
    Info: resolving vtable for cv::Exception by linking to __imp___ZTVN2cv9Exception
    E (auto-import)
    Creating library file: ..\..\bin\libopencv_perf_cored.dll.a
    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: warn
    ing: auto-importing has been activated without –enable-auto-import specified on
    the command line.
    This should work unless it involves constant data structures referencing symbols
    from auto-imported DLLs.
    Cannot export _ZN12_GLOBAL__N_13ROp3allEv: symbol not found
    Cannot export _ZN12_GLOBAL__N_13ROpC1Ei: symbol not found
    Cannot export _ZN12_GLOBAL__N_17CmpType3allEv: symbol not found
    Cannot export _ZN12_GLOBAL__N_17CmpTypeC1Ei: symbol not found
    Cannot export _ZNK12_GLOBAL__N_13ROp7PrintToEPSo: symbol not found
    Cannot export _ZNK12_GLOBAL__N_13ROpcviEv: symbol not found
    Cannot export _ZNK12_GLOBAL__N_17CmpType7PrintToEPSo: symbol not found
    Cannot export _ZNK12_GLOBAL__N_17CmpTypecviEv: symbol not found
    collect2: ld returned 1 exit status
    mingw32-make[2]: *** [bin/opencv_perf_cored.exe] Error 1
    mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
    mingw32-make: *** [all] Error 2

    Please reply and help me ASAP. I have got only 6 hours to submit the project.

    Thank you! :)