2012-05-03 16 views
5

E 'OpenCV-2.4.0non possono installare OpenCV dalla fonte

cd opencv 
mkdir release 
cd release 
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON .. 
make 

Errore:

In file included from OpenCV-2.4.0/modules/core/src/system.cpp:460: 
OpenCV-2.4.0/release/modules/core/version_string.inc:35:1: warning: missing terminating " character 
In file included from OpenCV-2.4.0/modules/core/src/system.cpp:460: 
OpenCV-2.4.0/release/modules/core/version_string.inc:35: error: missing terminating " character 
OpenCV-2.4.0/release/modules/core/version_string.inc:36:11: error: too many decimal points in number 
OpenCV-2.4.0/release/modules/core/version_string.inc:36:29: error: invalid suffix "st" on integer constant 
OpenCV-2.4.0/release/modules/core/version_string.inc:40:29: warning: character constant too long for its type 
OpenCV-2.4.0/release/modules/core/version_string.inc:57: error: stray ‘@’ in program 
OpenCV-2.4.0/release/modules/core/version_string.inc:57: error: stray ‘@’ in program 
OpenCV-2.4.0/release/modules/core/version_string.inc:68:10: error: #include expects "FILENAME" or <FILENAME> 
OpenCV-2.4.0/release/modules/core/version_string.inc:71: error: stray ‘\’ in program 
OpenCV-2.4.0/release/modules/core/version_string.inc:71:9: warning: missing terminating " character 
OpenCV-2.4.0/release/modules/core/version_string.inc:71: error: missing terminating " character 
OpenCV-2.4.0/release/modules/core/version_string.inc:74:23: warning: missing terminating " character 
OpenCV-2.4.0/release/modules/core/version_string.inc:1515: error: stray ‘\’ in program 
OpenCV-2.4.0/release/modules/core/version_string.inc:1515:4: warning: missing terminating " character 
OpenCV-2.4.0/release/modules/core/version_string.inc:1515: error: missing terminating " character 
OpenCV-2.4.0/release/modules/core/version_string.inc: In function ‘const std::string& cv::getBuildInformation()’: 
OpenCV-2.4.0/release/modules/core/version_string.inc:36: error: expected ‘,’ or ‘;’ before ‘version’ 
OpenCV-2.4.0/release/modules/core/version_string.inc:138: error: ‘z_stream’ was not declared in this scope 
OpenCV-2.4.0/release/modules/core/version_string.inc:140: error: expected ‘;’ before ‘typedef’ 
OpenCV-2.4.0/release/modules/core/version_string.inc:161: error: ‘gz_header’ was not declared in this scope 
OpenCV-2.4.0/release/modules/core/version_string.inc:163: error: expected ‘;’ before ‘typedef’ 
OpenCV-2.4.0/release/modules/core/version_string.inc:1505: error: ‘ZEXTERN’ was not declared in this scope 
OpenCV-2.4.0/release/modules/core/version_string.inc:1505: error: expected ‘;’ before ‘const’ 
OpenCV-2.4.0/release/modules/core/version_string.inc:1511: warning: no return statement in function returning non-void 
OpenCV-2.4.0/release/modules/core/version_string.inc: At global scope: 
OpenCV-2.4.0/release/modules/core/version_string.inc:1515: error: expected unqualified-id before ‘)’ token 
OpenCV-2.4.0/modules/core/src/system.cpp:462: error: expected unqualified-id before ‘return’ 
OpenCV-2.4.0/modules/core/src/system.cpp:465: error: ‘string’ does not name a type 
OpenCV-2.4.0/modules/core/src/system.cpp:474: error: ‘string’ does not name a type 
OpenCV-2.4.0/modules/core/src/system.cpp:503: error: ISO C++ forbids declaration of ‘Exception’ with no type 
OpenCV-2.4.0/modules/core/src/system.cpp:503: error: expected ‘,’ or ‘...’ before ‘&’ token 
OpenCV-2.4.0/modules/core/src/system.cpp: In function ‘void error(int)’: 
OpenCV-2.4.0/modules/core/src/system.cpp:506: error: ‘exc’ was not declared in this scope 
OpenCV-2.4.0/modules/core/src/system.cpp:510: error: ‘exc’ was not declared in this scope 
OpenCV-2.4.0/modules/core/src/system.cpp:526: error: ‘exc’ was not declared in this scope 
OpenCV-2.4.0/modules/core/src/system.cpp: At global scope: 
OpenCV-2.4.0/modules/core/src/system.cpp:543: 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 

Cosa devo fare?

+0

Scrivi una segnalazione di errore. http://code.opencv.org/ – ypnos

+0

@ypnos, per favore non incoraggiare segnalazioni di bug falsi. – fireant

+1

@Shambool, questo non è fasullo. OpenCV2.4.0 non riesce a costruire su Debian 6.0. – etarion

risposta

7

Avevo lo stesso problema nel creare OpenCV-2.4.0 su Debian 6.0. Guardando release/modules/core/version_string.inc ha mostrato il " mancante anche un commento mancante /*, che si è verificato in using zlib v1:1.2.3.4.dfsg-3. Ho riconfigurato con BUILD_ZLIB e non ho avuto problemi.

+3

La compilazione fallisce a causa del bug di CMake 2.8.2. Vedi http://code.opencv.org/issues/1902 per i dettagli. –

2

Ho appena scaricato OpenCV 2.4.0 fonti dal repository (rev 8300) e ho avuto problemi di costruzione su Linux:

$ svn info 
Path: . 
URL: http://code.opencv.org/svn/opencv/tags/2.4.0/opencv 
Repository Root: http://code.opencv.org/svn/opencv 
Repository UUID: c5418bc3-7546-4aae-8bad-fa6f2f3e53e6 
Revision: 8300 
Node Kind: directory 
Schedule: normal 
Last Changed Author: marina.kolpakova 
Last Changed Rev: 8282 
Last Changed Date: 2012-04-30 16:06:37 -0300 (Mon, 30 Apr 2012) 

$ mkdir build 
$ cd build 
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON .. 
$ make 

20 minuti dopo che era finita e con successo compilato.

+0

Qualcuno ha votato la mia risposta, vorrei che spiegassero perché. – karlphillip

3

Ho avuto lo stesso problema, ho cambiato il file CMakeLists.txt sostituendo la linea:

OCV_OPTION(BUILD_ZLIB    "Build zlib from source"   WIN32 OR IOS OR APPLE) 

con:

OCV_OPTION(BUILD_ZLIB  "Build zlib from source" ON) # WIN32 OR IOS OR APPLE) 

e tutto preso bene.

0

Ho avuto lo stesso problema. Sembra che l'errore provenga da cmake 2.8.2. Ho aggiornato alla versione 2.8.8 e finalmente ho potuto installare opencv 2.4.0.

Problemi correlati