in reply to Re: How to link to OpenCV goodies for PERL5
in thread How to link to OpenCV goodies for PERL5

I ran /usr/bin/nm and it reads that cvLoad and cvLoadImage are Undefined. That can't be good.

I originally loaded opencv via the instructions at opencv and then later followed the instructions found here:

http://linuxgazette.net/176/misc/lg/face_detection_in_perl.html

I tried cpan Image::ObjectDetect again and it tells me that it is installed and up to date.

I would try to make manually against the source, but I don't know where the source is. I found this to help me:

http://world.std.com/~swmcd/steven/perl/module_mechanics.html#TOC19

When I google for more information I get this thread...

Thanks for your help, I will change the printing if it ever works ;)

  • Comment on Re^2: How to link to OpenCV goodies for PERL5

Replies are listed 'Best First'.
Re^3: How to link to OpenCV goodies for PERL5
by hbm (Hermit) on Jun 09, 2013 at 18:53 UTC

    When you install modules with CPAN, the source is first downloaded to your .cpan directory - should be in the home directory of whatever account you installed with.

    1. 'find' or 'locate' the source (under the author)
    2. Change to that directory
    3. /path/to/perl Makefile.PL
    4. make > make.log 2>&1

    Hopefully make.log will then get you closer to the root cause.

      Thank you for your help. I did what you said and here is what was outputted into make.log:

      freddythunder@tacofever:~/cpan/objdetectsrc$ more make.log cp lib/Image/ObjectDetect.pm blib/lib/Image/ObjectDetect.pm cp lib/Image/ObjectDetect.xs blib/lib/Image/ObjectDetect.xs /usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/shar +e/perl/5.14/ExtUtils/typemap ObjectDetect.xs > ObjectDetect.xsc && m +v ObjectDetect. xsc ObjectDetect.c cc -c -I/usr/local/include/opencv -I/usr/local/include -Isrc -I/usr +/local/include/opencv -I/usr/local/include -O2 -g -DVERSION=\"0.1 +2\" -DXS_VERSIO N=\"0.12\" -fPIC "-I/usr/lib/perl/5.14/CORE" ObjectDetect.c Running Mkbootstrap for Image::ObjectDetect () chmod 644 ObjectDetect.bs rm -f blib/arch/auto/Image/ObjectDetect/ObjectDetect.so cc -shared -L/usr/local/lib -fstack-protector ObjectDetect.o -o blib +/arch/auto/Image/ObjectDetect/ObjectDetect.so \ \ chmod 755 blib/arch/auto/Image/ObjectDetect/ObjectDetect.so cp ObjectDetect.bs blib/arch/auto/Image/ObjectDetect/ObjectDetect.bs chmod 644 blib/arch/auto/Image/ObjectDetect/ObjectDetect.bs Manifying blib/man3/Image::ObjectDetect.3pm

      I also had read somewhere about 'make test' which I remember the output of that happening before (but I don't remember at what point) but the test fails:

      freddythunder@tacofever:~/cpan/objdetectsrc$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00_compile.t .. 1/2 # Failed test 'use Image::ObjectDetect;' # at t/00_compile.t line 7. # Tried to use 'Image::ObjectDetect'. # Error: Can't load '/home/freddythunder/cpan/objdetectsrc/blib/a +rch/auto/Image/ObjectDetect/ObjectDetect.so' for module Image::Object +Detect: /home/freddythunder/cpan/objdetectsrc/blib/arch/auto/Image/Ob +jectDetect/ObjectDetect.so: undefined symbol: cvHaarDetectObjects at +/usr/lib/perl/5.14/DynaLoader.pm line 184. # at /home/freddythunder/cpan/objdetectsrc/blib/lib/Image/ObjectDetec +t.pm line 19 # BEGIN failed--compilation aborted at /home/freddythunder/cpan/objdet +ectsrc/blib/lib/Image/ObjectDetect.pm line 19. # Compilation failed in require at (eval 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. # Failed test 'Image::ObjectDetect->can('xs_detect')' # at t/00_compile.t line 8. # Image::ObjectDetect->can('xs_detect') failed # Looks like you failed 2 tests of 2. t/00_compile.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/2 subtests t/01_detect.t ... Can't load '/home/freddythunder/cpan/objdetectsrc/bl +ib/arch/auto/Image/ObjectDetect/ObjectDetect.so' for module Image::Ob +jectDetect: /home/freddythunder/cpan/objdetectsrc/blib/arch/auto/Imag +e/ObjectDetect/ObjectDetect.so: undefined symbol: cvHaarDetectObjects + at /usr/lib/perl/5.14/DynaLoader.pm line 184. at /home/freddythunder/cpan/objdetectsrc/blib/lib/Image/ObjectDetect. +pm line 19 BEGIN failed--compilation aborted at /home/freddythunder/cpan/objdetec +tsrc/blib/lib/Image/ObjectDetect.pm line 19. Compilation failed in require at t/01_detect.t line 5. BEGIN failed--compilation aborted at t/01_detect.t line 5. t/01_detect.t ... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Test Summary Report ------------------- t/00_compile.t (Wstat: 512 Tests: 2 Failed: 2) Failed tests: 1-2 Non-zero exit status: 2 t/01_detect.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=2, Tests=2, 0 wallclock secs ( 0.09 usr 0.02 sys + 0.14 cusr + 0.04 csys = 0.29 CPU) Result: FAIL Failed 2/2 test programs. 2/2 subtests failed. make: *** [test_dynamic] Error 255

        What do you get as output of pkg-config opencv --libs

        It seems suspicious that your make log lacks some form of -lopencv or libopencv.a or some such

        seems odd that you'd have ...include/opencv but no libopencv