1

I'm using Ubuntu 14.04 , OpenCV 3.0.0, this is the list of commands and errors to try my opencv library after being installed

    linaro@linaro-nano:~/opencv/samples/cpp$ ./cpp-example-facedetect lena.jpg

    This program demonstrates the cascade recognizer. Now you can use Haar or LBP features.
    This classifier can recognize many kinds of rigid objects, once the appropriate classifier is trained.
    It's most known use is for faces.
    Usage:
    ./facedetect [--cascade=<cascade_path> this is the primary trained classifier such as frontal face]
       [--nested-cascade[=nested_cascade_path this an optional secondary classifier such as eyes]]
       [--scale=<image scale greater or equal to 1, try 1.3 for example>]
       [--try-flip]
       [filename|camera_index]

    see facedetect.cmd for one call:
    ./facedetect --cascade="../../data/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="../../data/haarcascades/haarcascade_eye.xml" --scale=1.3

    During execution:
        Hit any key to quit.
        Using OpenCV version 3.0.0-dev

    Processing 1 lena.jpg
    Capture from AVI didn't work
    OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /home/linaro/nourelhak/opencv/modules/highgui/src/window.cpp, line 522
    terminate called after throwing an instance of 'cv::Exception'
      what():  /home/linaro/opencv/modules/highgui/src/window.cpp:522: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow

    Aborted


    linaro@linaro-nano:~opencv/samples/cpp$ sudo apt-get install cmake git libgtk2.0-dev pkg-config 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    cmake is already the newest version.
    git is already the newest version.
    pkg-config is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
                     Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    linaro@linaro-nano:~/opencv/samples/cpp$ sudo apt-get install libgtk2.0-dev libpango1-dev libcairo2-dev libfontconfig1-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libpango1-dev

        linaro@linaro-nano:~/opencv/samples/cpp$ apt-cache policy libfontconfig1
        libfontconfig1:
          Installed: 2.11.0-0ubuntu4
          Candidate: 2.11.0-0ubuntu4
          Version table:
         *** 2.11.0-0ubuntu4 0
                500 http://ports.ubuntu.com/ubuntu-ports/ trusty/main armhf Packages
                100 /var/lib/dpkg/status
        linaro@linaro-nano:~/opencv/samples/cpp$ apt-cache madison libfontconfig1
        libfontconfig1 | 2.11.0-0ubuntu4 | http://ports.ubuntu.com/ubuntu-ports/ trusty/main armhf Packages
        fontconfig | 2.11.0-0ubuntu4 | http://ports.ubuntu.com/ubuntu-ports/ trusty/main Sources

  linaro@linaro-nano:~/nourelhak/opencv/samples/cpp$ sudo apt-get install libpango1.0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpango1.0-dev : Depends: libfreetype6-dev but it is not going to be installed
                   Depends: libxft-dev but it is not going to be installed
                   Depends: libfontconfig1-dev (>= 2.10.91) but it is not going to be installed
                   Depends: libcairo2-dev (>= 1.12.10) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
linaro@linaro-nano:~/nourelhak/opencv/samples/cpp$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
linaro@linaro-nano:~/nourelhak/opencv/samples/cpp$ sudo apt-get install libgtk2.0-dev libpango1-dev libcairo2-dev libfontconfig1-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libpango1-dev
linaro@linaro-nano:~/nourelhak/opencv/samples/cpp$ sudo apt-get install libgtk2.0-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcairo2-dev : Depends: libfreetype6-dev (>= 2.1.10) but it is not going to be installed
 libfontconfig1-dev : Depends: libfreetype6-dev (>= 2.1.7) but it is not going to be installed
 libpango1.0-dev : Depends: libfreetype6-dev but it is not going to be installed
                   Depends: libxft-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
linaro@linaro-nano:~/nourelhak/opencv/samples/cpp$

I have had libgtk2.0-dev failed to be installed from the begining , but I thought I force it with aptitude instead of apt-get

  • Which Ubuntu version are you using? what's the output of sudo dpkg --get-selections | grep "hold"? – Ron Aug 17 '15 at 16:13
  • i'm using ubuntu-14.04-hdmi-z7020-20140611.img.gz for parallella board , I will check the output and publish it as soon as possible – Riwa Ml Aug 17 '15 at 21:18
  • Ron this command sudo dpkg --get-selections | grep "hold" the output is nothing – Riwa Ml Aug 20 '15 at 12:03
1

As I see from your output, the error is:

E: Unable to locate package libpango1-dev

There is no package called libpango1-dev, instead it is libpango1.0-dev

To install libpango1.0-dev, use:

sudo apt-get install libpango1.0-dev`
0

run command

sudo apt-get -f install
sudo apt-get install libgtk2.0-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev

it will install broken dependency and also try this link

EDIT: try this command

sudo aptitude install libpango1.0-0=1.29.3+git20110916-0ubuntu1 plymouth-x11=0.8.2-2ubuntu28 libpango1.0-dev=1.29.3+git20110916-0ubuntu1 gir1.2-pango-1.0=1.29.3+git20110916-0ubuntu1

hope it will work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.