Find the answer to your Linux question:
Results 1 to 3 of 3
hey... just recently installed opencv in fedora core 5... i faced few problems..i searched whole net .. tried out all the solutions still ended up unsuccessful.. i tried out the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    15

    Trying to install opencv


    hey... just recently installed opencv in fedora core 5...
    i faced few problems..i searched whole net .. tried out all the solutions still ended up unsuccessful.. i tried out the following...
    1. checked with pkg-config path
    2. checked with the dependencies of that highgui library by ldd.. and everything is fine...
    3. checked with ld.so.conf paths and ran ldconfig too... made sure that the path of the libraries are correct...
    4. i put all possible flags... but still no success...
    5. i'm facing only problem with libhighgui.so and not with the other libraries installed by opencv.. like libcv.so or libcxcore.so....

    is there anything else that i missed out... i hope i did miss out something... please help.. spent whole day trying to solve...

    Code:
    // opencv0.c - creating and displaying an image using Intel OpenCV 
     
    #include "cv.h"  
    #include "highgui.h" 
    #include <stdio.h> 
    int main() 
    { 
    IplImage *cvImg; 
    CvSize imgSize; 
    int i = 0, j = 0; 
    imgSize.width = 640; 
    imgSize.height = 480; 
    cvImg = cvCreateImage( imgSize, 8, 1 ); 
    for ( i = 0; i < imgSize.width; i++ ) 
    for ( j = 0; j < imgSize.height; j++ ) 
    ((uchar*)(cvImg->imageData + cvImg->widthStep*j))[i] = 
    ( char ) ( ( i * j ) % 256 ); 
    cvNamedWindow( "Testing OpenCV...", 1 ); 
    cvShowImage( "Testing OpenCV...", cvImg ); 
    cvWaitKey( 0 ); 
    cvDestroyWindow( "image" ); 
    cvReleaseImage( &cvImg ); 
    return( 0 ); 
    } 
    -------------------------------------------------------- 
    [raj@localhost opencv]$ gcc -I/home/intel/opencv/include/opencv -L/home/intel/opencv/lib -lcv -lhighgui -lstdc++ opencv0.c -o opencv0 
     
    /tmp/cce0crrm.o: In function `main':opencv0.c:(.text+0x39ea): undefined reference to `cvNamedWindow' 
    :opencv0.c:(.text+0x39fd): undefined reference to `cvShowImage' 
    :opencv0.c:(.text+0x3a09): undefined reference to `cvWaitKey' 
    :opencv0.c:(.text+0x3a15): undefined reference to `cvDestroyWindow' 
    collect2: ld returned 1 exit status 
    [raj@localhost opencv]$ 
    -------------------------------------------------------------- 
    these are the libraries that are related to opencv... 
     
    /home/intel/opencv/lib: 
    libcxcore.so.0 -> libcxcore.so.0.9.9 
    libcvaux.so.0 -> libcvaux.so.0.9.9 
    libcv.so.0 -> libcv.so.0.9.9 
    libml.so.0 -> libml.so.0.9.9 
    libhighgui.so.0 -> libhighgui.so.0.9.9
    please help...

    thanks in advance....
    varun

  2. #2
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    You're including "cv.h". I assume there's a cv.c, and a cv.o in your current directory. Try adding cv.o to your command line right after opencv0.c and see what happens.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Posts
    1

    your prog.work

    Quote Originally Posted by smart0730 View Post
    hey... just recently installed opencv in fedora core 5...
    i faced few problems..i searched whole net .. tried out all the solutions still ended up unsuccessful.. i tried out the following...
    1. checked with pkg-config path
    2. checked with the dependencies of that highgui library by ldd.. and everything is fine...
    3. checked with ld.so.conf paths and ran ldconfig too... made sure that the path of the libraries are correct...
    4. i put all possible flags... but still no success...
    5. i'm facing only problem with libhighgui.so and not with the other libraries installed by opencv.. like libcv.so or libcxcore.so....

    is there anything else that i missed out... i hope i did miss out something... please help.. spent whole day trying to solve...

    Code:
    // opencv0.c - creating and displaying an image using Intel OpenCV 
     
    #include "cv.h"  
    #include "highgui.h" 
    #include <stdio.h> 
    int main() 
    { 
    IplImage *cvImg; 
    CvSize imgSize; 
    int i = 0, j = 0; 
    imgSize.width = 640; 
    imgSize.height = 480; 
    cvImg = cvCreateImage( imgSize, 8, 1 ); 
    for ( i = 0; i < imgSize.width; i++ ) 
    for ( j = 0; j < imgSize.height; j++ ) 
    ((uchar*)(cvImg->imageData + cvImg->widthStep*j))[i] = 
    ( char ) ( ( i * j ) % 256 ); 
    cvNamedWindow( "Testing OpenCV...", 1 ); 
    cvShowImage( "Testing OpenCV...", cvImg ); 
    cvWaitKey( 0 ); 
    cvDestroyWindow( "image" ); 
    cvReleaseImage( &cvImg ); 
    return( 0 ); 
    } 
    -------------------------------------------------------- 
    [raj@localhost opencv]$ gcc -I/home/intel/opencv/include/opencv -L/home/intel/opencv/lib -lcv -lhighgui -lstdc++ opencv0.c -o opencv0 
     
    /tmp/cce0crrm.o: In function `main':opencv0.c:(.text+0x39ea): undefined reference to `cvNamedWindow' 
    :opencv0.c:(.text+0x39fd): undefined reference to `cvShowImage' 
    :opencv0.c:(.text+0x3a09): undefined reference to `cvWaitKey' 
    :opencv0.c:(.text+0x3a15): undefined reference to `cvDestroyWindow' 
    collect2: ld returned 1 exit status 
    [raj@localhost opencv]$ 
    -------------------------------------------------------------- 
    these are the libraries that are related to opencv... 
     
    /home/intel/opencv/lib: 
    libcxcore.so.0 -> libcxcore.so.0.9.9 
    libcvaux.so.0 -> libcvaux.so.0.9.9 
    libcv.so.0 -> libcv.so.0.9.9 
    libml.so.0 -> libml.so.0.9.9 
    libhighgui.so.0 -> libhighgui.so.0.9.9
    please help...

    thanks in advance....
    varun
    I alrady finish installation my ubuntu Linux with opencv using debean commands and when i try your program I see it work and a window apears to me with the result of circles. then nothing wrong with your code the wrong is with your files of opencv program may be it not install correcctly
    try this command to compile your program which I renamed it as te.c
    root@znaz-desktop:/home/znaz/CandOpenCV# g++ -ggdb `pkg-config opencv --cflags --libs` te.c -o te
    Good Luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •