LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   OpenCV 2.4.2 installation failed on Debian Squeeze (http://www.linuxquestions.org/questions/linux-software-2/opencv-2-4-2-installation-failed-on-debian-squeeze-4175422856/)

Edenkips 08-19-2012 02:00 AM

OpenCV 2.4.2 installation failed on Debian Squeeze
 
Hello all, when I was trying to install OpenCV, I got this error while building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o

FYI: I'm running the latest version of Debian Squeeze... if that helps.

Thanks in advance

---------------------------------------------------------------------


[ 11%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
In file included from /home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:460:
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:37:1: warning: missing terminating " character
In file included from /home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:460:
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:37: error: missing terminating " character
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:38:11: error: too many decimal points in number
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:38:29: error: invalid suffix "st" on integer constant
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:42:29: warning: character constant too long for its type
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:59: error: stray ‘@’ in program
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:59: error: stray ‘@’ in program
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:70:10: error: #include expects "FILENAME" or <FILENAME>
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:73: error: stray ‘\’ in program
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:73:9: warning: missing terminating " character
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:73: error: missing terminating " character
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:76:23: warning: missing terminating " character
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1482:32: warning: "_FILE_OFFSET_BITS" is not defined
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1517: error: stray ‘\’ in program
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1517:4: warning: missing terminating " character
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1517: error: missing terminating " character
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc: In function ‘const std::string& cv::getBuildInformation()’:
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:38: error: expected ‘,’ or ‘;’ before ‘version’
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:140: error: ‘z_stream’ was not declared in this scope
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:142: error: expected ‘;’ before ‘typedef’
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:163: error: ‘gz_header’ was not declared in this scope
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:165: error: expected ‘;’ before ‘typedef’
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1507: error: ‘ZEXTERN’ was not declared in this scope
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1507: error: expected ‘;’ before ‘const’
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1513: error: no return statement in function returning non-void [-Wreturn-type]
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc: At global scope:
/home/edenkips/OpenCV-2.4.2/release/modules/core/version_string.inc:1517: error: expected unqualified-id before ‘)’ token
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:462: error: expected unqualified-id before ‘return’
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:465: error: ‘string’ does not name a type
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:474: error: ‘string’ does not name a type
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp: In function ‘bool setBreakOnError(bool)’:
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:535: warning: no previous declaration for ‘bool setBreakOnError(bool)’ [-Wmissing-declarations]
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp: At global scope:
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:542: error: ISO C++ forbids declaration of ‘Exception’ with no type [-fpermissive]
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:542: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp: In function ‘void error(int)’:
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:542: warning: no previous declaration for ‘void error(int)’ [-Wmissing-declarations]
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:545: error: ‘exc’ was not declared in this scope
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:549: error: ‘exc’ was not declared in this scope
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:565: error: ‘exc’ was not declared in this scope
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp: At global scope:
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:542: warning: unused parameter ‘Exception’ [-Wunused-parameter]
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp: In function ‘int (* redirectError(int (*)(int, const char*, const char*, const char*, int, void*), void*, void**))(int, const char*, const char*, const char*, int, void*)’:
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:569: warning: no previous declaration for ‘int (* redirectError(int (*)(int, const char*, const char*, const char*, int, void*), void*, void**))(int, const char*, const char*, const char*, int, void*)’ [-Wmissing-declarations]
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp: At global scope:
/home/edenkips/OpenCV-2.4.2/modules/core/src/system.cpp:582: error: expected declaration before ‘}’ token
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2

knudfl 08-19-2012 04:06 AM

Welcome to LQ.

Probably use the seven patches for OpenCV-2.4.2
http://ftp.de.debian.org/debian/pool....debian.tar.gz


Or better : 1) # apt-get build-dep opencv && exit

2) $ cd <new-folder>/ && apt-get -b source opencv=2.4.2+dfsg-0exp1
..... which will build all the (38 ?) Debian packages
http://packages.debian.org/source/experimental/opencv

You will have to add a line in /etc/apt/sources.list to use the Debian "2.4.2 source code" :
deb-src <your-usual-url> experimental main
... like
deb-src http://ftp.de.debian.org/debian experimental main


.

Edenkips 08-19-2012 11:40 PM

Thank you for welcoming me to the community.

I tried to install the dependencies, but it gave me even more errors while trying to install the package, I followed the steps, so I don't know what I'm doing wrong, Thanks again.



[ 1%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
cd /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core && /usr/bin/c++ -Dopencv_core_EXPORTS -DHAVE_CVCONFIG_H -DCVAPI_EXPORTS -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -mfpmath=387 -ffunction-sections -g -O2 -DNDEBUG -fPIC -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu -isystem /usr/include/eigen2 -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/include -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/ts/include -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/highgui/include -isystem /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/perf -include "/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/precomp.hpp" -Winvalid-pch -o CMakeFiles/opencv_core.dir/src/system.cpp.o -c /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp
In file included from /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:460:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:37: error: missing terminating " character
In file included from /home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:460:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:38:11: error: too many decimal points in number
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:38:29: error: invalid suffix "st" on integer constant
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:59: error: stray ‘@’ in program
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:59: error: stray ‘@’ in program
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:70:10: error: #include expects "FILENAME" or <FILENAME>
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:73: error: stray ‘\’ in program
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:73: error: missing terminating " character
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:1517: error: stray ‘\’ in program
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:1517: error: missing terminating " character
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc: In function ‘const std::string& cv::getBuildInformation()’:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:38: error: expected ‘,’ or ‘;’ before ‘version’
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:140: error: ‘z_stream’ was not declared in this scope
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:142: error: expected ‘;’ before ‘typedef’
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:163: error: ‘gz_header’ was not declared in this scope
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:165: error: expected ‘;’ before ‘typedef’
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:1507: error: ‘ZEXTERN’ was not declared in this scope
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:1507: error: expected ‘;’ before ‘const’
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc: At global scope:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu/modules/core/version_string.inc:1517: error: expected unqualified-id before ‘)’ token
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:462: error: expected unqualified-id before ‘return’
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:465: error: ‘string’ does not name a type
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:474: error: ‘string’ does not name a type
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp: In function ‘bool setBreakOnError(bool)’:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:535: warning: no previous declaration for ‘bool setBreakOnError(bool)’ [-Wmissing-declarations]
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp: At global scope:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:542: error: ISO C++ forbids declaration of ‘Exception’ with no type [-fpermissive]
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:542: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp: In function ‘void error(int)’:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:542: warning: no previous declaration for ‘void error(int)’ [-Wmissing-declarations]
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:545: error: ‘exc’ was not declared in this scope
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:549: error: ‘exc’ was not declared in this scope
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:565: error: ‘exc’ was not declared in this scope
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp: At global scope:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:542: warning: unused parameter ‘Exception’ [-Wunused-parameter]
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp: In function ‘int (* redirectError(int (*)(int, const char*, const char*, const char*, int, void*), void*, void**))(int, const char*, const char*, const char*, int, void*)’:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:569: warning: no previous declaration for ‘int (* redirectError(int (*)(int, const char*, const char*, const char*, int, void*), void*, void**))(int, const char*, const char*, const char*, int, void*)’ [-Wmissing-declarations]
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp: At global scope:
/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/modules/core/src/system.cpp:582: error: expected declaration before ‘}’ token
make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
make[3]: Leaving directory `/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu'
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[2]: Leaving directory `/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/edenkips/Downloads/debian/opencv-2.4.2+dfsg/obj-i486-linux-gnu'
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
Build command 'cd opencv-2.4.2+dfsg && dpkg-buildpackage -b -uc' failed.
E: Child process failed

knudfl 08-20-2012 04:14 AM

1) A manual build :
# apt-get build-dep opencv && apt-get install libeigen2-dev
I applied the seven patches : The build fails here too on Debian Squeeze.

2) Package build : $ 'apt-get -b source opencv=2.4.2+dfsg-0exp1' : Fails too.

3) $ 'rpmbuild -bb opencv.spec' , also on Debian Squeeze
.... with the Fedora 18 source SRC.RPM opencv-2.4.2-2.fc18.src.rpm : Fails.

But then again, it is a new ( experimental ? ) version.

.

Edenkips 08-20-2012 11:53 AM

Oh! I have figured out that the problem is that the cmake is not the latest version, I just upgraded cmake to the latest version from the cmake website. OpenCV finally compiled smoothly without any problems, Thanks anyways.


All times are GMT -5. The time now is 08:34 AM.