LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   OpenCV 2.0 compile error in -current (https://www.linuxquestions.org/questions/slackware-14/opencv-2-0-compile-error-in-current-793804/)

mlpa 03-07-2010 11:22 AM

OpenCV 2.0 compile error in -current
 
Hi, I use Slackware64 -current, since last big update I can't compile OpenCV 2.0, this is the error:
Quote:

libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include/opencv -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -O3 -g -march=x86-64 -ffast-math -fomit-frame-pointer -O2 -fPIC -MT lib_highgui_la-grfmt_png.lo -MD -MP -MF .deps/lib_highgui_la-grfmt_png.Tpo -c highgui/grfmt_png.cpp -fPIC -DPIC -o .libs/lib_highgui_la-grfmt_png.o
highgui/grfmt_png.cpp: In static member function 'static void cv::PngDecoder::readDataFromBuf(void*, uchar*, size_t)':
highgui/grfmt_png.cpp:110: warning: 'png_struct_def::io_ptr' is deprecated (declared at /usr/include/libpng/png.h:1104)
highgui/grfmt_png.cpp:110: warning: 'png_struct_def::io_ptr' is deprecated (declared at /usr/include/libpng/png.h:1104)
highgui/grfmt_png.cpp: In member function 'virtual bool cv::PngDecoder::readHeader()':
highgui/grfmt_png.cpp:141: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/libpng/png.h:1090)
highgui/grfmt_png.cpp:141: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/libpng/png.h:1090)
highgui/grfmt_png.cpp: In member function 'virtual bool cv::PngDecoder::readData(cv::Mat&)':
highgui/grfmt_png.cpp:203: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/libpng/png.h:1090)
highgui/grfmt_png.cpp:203: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/libpng/png.h:1090)
highgui/grfmt_png.cpp:226: error: 'png_set_gray_1_2_4_to_8' was not declared in this scope
highgui/grfmt_png.cpp: In static member function 'static void cv::PngEncoder::writeDataToBuf(void*, uchar*, size_t)':
highgui/grfmt_png.cpp:283: warning: 'png_struct_def::io_ptr' is deprecated (declared at /usr/include/libpng/png.h:1104)
highgui/grfmt_png.cpp:283: warning: 'png_struct_def::io_ptr' is deprecated (declared at /usr/include/libpng/png.h:1104)
highgui/grfmt_png.cpp: In member function 'virtual bool cv::PngEncoder::write(const cv::Mat&, const std::vector<int, std::allocator<int> >&)':
highgui/grfmt_png.cpp:325: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/libpng/png.h:1090)
highgui/grfmt_png.cpp:325: warning: 'png_struct_def::jmpbuf' is deprecated (declared at /usr/include/libpng/png.h:1090)
make[2]: *** [lib_highgui_la-grfmt_png.lo] Error 1
make[2]: Leaving directory `/tmp/SBo/OpenCV-2.0.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/SBo/OpenCV-2.0.0'
make: *** [all] Error 2
Can someone help me?

ponce 03-07-2010 12:25 PM

you can try this patch: here you can find a modified slackbuild too, if needed (it shows you also how to apply the patch) :)

mlpa 04-10-2010 11:09 AM

Hi, I'm trying to compile the new version of opencv.
I'm using Slackware64 13.0, I do all the things in the README but when I run make -j 2 at 88% just give a error, but none output.

What can I do?

ponce 04-10-2010 01:48 PM

you can try with this slackbuild and patches (the same as above but on another link), just comment out the libpng patch from the slackbuild if you are not on current.

mlpa 04-10-2010 04:35 PM

Hi ponce, thanks for the reply.
I have tried with opencv 2.1.0, but the patch that correct the name of the libs fails.
So I tried with opencv 2.0.0, but i get this error:

Quote:

Scanning dependencies of target createsamples
[ 88%] Building CXX object apps/haartraining/CMakeFiles/createsamples.dir/createsamples.o
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libhighgui.so.2.0.0: undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_createsamples] Error 1
make[1]: *** [apps/haartraining/CMakeFiles/createsamples.dir/all] Error 2
make: *** [all] Error 2
I have tried install libv4l, but the error maintains.
Can someone help me?

Another question, why is this scrip not in slackbuilds?

ponce 04-11-2010 09:32 AM

try this slackbuild on stable, uncomment the libpng patch on current.

why it's not on slackbuilds? I'm not the maintainer of opencv on slackbuilds.org :)

mlpa 04-11-2010 02:49 PM

I will try as soon as I can and I will report.
Ok, but in slackbuilds there is only script for version 1.1pre1 not for 2 or 2.1

mlpa 04-11-2010 06:19 PM

Thanks, this last script run like a charm.
It's installed and working.

I think you should submit this to slackbuilds, it's just a big help.

sphinx 05-06-2010 01:33 AM

Quote:

Originally Posted by ponce (Post 3889366)
you can try this patch: here you can find a modified slackbuild too, if needed (it shows you also how to apply the patch) :)

This link doesn't work. can You fix it or send me other?

sphinx 05-06-2010 01:34 AM

This link doesn't works :(

sphinx 05-06-2010 01:38 AM

this links doesn't works. can You fix it. or send me this slackbuild?

ponce 05-06-2010 03:21 AM

it's here.

if you need another specific patch just go on SBo-git homepage, select the available patches from "branches" and click on the "commit" link.

or you can use this stuff directly with sbopkg :)

mlpa 05-25-2010 05:20 AM

Hey, I update Slackware to new version 13.1.
And now When I compile opencv 2.1 I can get V4L/V4l2 active so I can use my camera.

Quote:

-- General configuration for opencv 2.1.0 =====================================
--
-- Built as dynamic libs?: ON
-- Compiler:
-- C++ flags (Release): -Wall -pthread -march=i686 -ffunction-sections -O3 -DNDEBUG -fomit-frame-pointer -O3 -ffast-math -msse -msse2 -mfpmath=387 -DNDEBUG
-- C++ flags (Debug): -Wall -pthread -march=i686 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -L/usr/lib -L/lib
-- Linker flags (Debug): -L/usr/lib -L/lib
--
-- GUI:
-- GTK+ 2.x: 1
-- GThread: 1
--
-- Image I/O:
-- JPEG: TRUE
-- PNG: TRUE
-- TIFF: TRUE
-- JPEG 2000: TRUE
--
-- Video I/O:
-- DC1394 1.x: 0
-- DC1394 2.x: 0
-- FFMPEG: 0
-- codec: 0
-- format: 0
-- util: 0
-- swscale: 0
-- gentoo-style:
-- GStreamer: 1
-- UniCap:
-- PvAPI:
-- V4L/V4L2: FALSE/FALSE
-- Xine: 1
--
-- Interfaces:
-- Old Python: 0
-- Python: ON
-- Python interpreter: /usr/bin/python2.6
-- Python numpy: 0
-- Use IPP: NO
-- Use TBB: NO
-- Build Documentation 0
--
-- Install path: /usr
--
-- cvconfig.h is in: /tmp/SBo/OpenCV-2.1.0/build
-- -----------------------------------------------------------------
Cab anyone help me?

ponce 05-25-2010 05:34 AM

dunno, sorry: have the same behaviour and looked around a little, also on users mailing list and trac tickets but with no luck... :(

I can see in slackbuilds.org git repository that they patched 1.1pre1 but have not tried it yet...

mlpa 05-25-2010 05:55 PM

Since Slackware uses a library called V4L-utils insted V4L/V4L2 opencv don't recognize may camera.

I solved the issue adding this option to cmake
Quote:

-DWITH_V4L=true


All times are GMT -5. The time now is 08:02 PM.