2013-08-14 23 views
8

Forse mi manca qualcosa ma non riesco a creare le librerie statiche di opencv.Creazione di OpenCV come librerie statiche

Setup:

Kubuntu 12.04

gcc 4.6.3

fanno 3,81

cmake 2.8.7

OpenCV 2.4.6.1 (ultimo disponibile sul sito)

Faccio tutto il lavoro manualmente. Ho provato con cmake-gui senza più successo.

Faccio quello che è scritto.

$ cmake -D CMAKE_BUILD_TYPE = STAMPA -D CMAKE_INSTALL_PREFIX =/usr/local -D BUILD_PYTHON_SUPPORT = ON -D WITH_QT = ON -D BUILD_SHARED_LIBRARIES = OFF ..

(ho anche provato con BUILD_SHARED_LIBRARIES = NO)

Quello che ottengo è (per il core per esempio):

  • libopencv_core.so
  • libopencv_core.so.2.4
  • libopencv_ core.so.2.4.6
  • libopencv_core_pch_dephelp.a

A dire il vero, mi aspettavo libopencv_core.a.

Sono un principiante con pacchetti/librerie su Linux. Sono sicuro che c'è qualcosa che ho fatto di sbagliato, ma non so cosa. Inoltre non voglio usare le librerie dinamiche ...

Grazie per il vostro aiuto!

EDIT Rimosso lo spazio vuoto tra -D ... in CMake riga di comando

Result: 

-- General configuration for OpenCV 2.4.6.1 ===================================== 
-- Version control:    unknown 
-- 
-- Platform: 
--  Host:      Linux 3.2.0-51-generic x86_64 
--  CMake:      2.8.7 
--  CMake generator:    Unix Makefiles 
--  CMake build tool:   /usr/bin/make 
--  Configuration:    RELEASE 
-- 
-- C/C++: 
--  Built as dynamic libs?:  YES 
--  C++ Compiler:    /usr/bin/c++ (ver 4.6) 
--  C++ flags (Release):   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG 
--  C++ flags (Debug):   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3 
--  C Compiler:     /usr/bin/gcc 
--  C flags (Release):   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG 
--  C flags (Debug):    -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3 
--  Linker flags (Release):  
--  Linker flags (Debug):   
--  Precompiled headers:   YES 
-- 
-- OpenCV modules: 
--  To be built:     core imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu nonfree java python stitching superres ts videostab 

...

-- Configuring done 
-- Generating done 
CMake Warning: 
    Manually-specified variables were not used by the project: 

    BUILD_PYTHON_SUPPORT 
    BUILD_SHARED_LIBRARIES 

vedo ancora Costruito come librerie dinamiche ?: SI e mi dice che non interessa la variabile BUILD_SHARED_LIBRARIES!

+0

Hai provato invocando CMake senza spazi tra le 'bandiere -D' ed i loro valori? Quindi, ad es. 'cmake. -DCMAKE_BUILD_TYPE = Rilascio ...-DBUILD_SHARED_LIBRARIES = OFF' – Fraser

+0

L'ho provato senza successo. Vedi la ** EDIT ** nella mia domanda. –

+1

Stupido sono! È ** - DBUILD_SHARED_LIBS = NO **! Non BUILD_SHARED_LIBRARIES ... –

risposta

15

Guardando a OpenCV's CMakeLists.txt, sembra che si stiano utilizzando i nomi sbagliati per le opzioni di OpenCV CMake.

BUILD_SHARED_LIBRARIES dovrebbe essere BUILD_SHARED_LIBS e BUILD_PYTHON_SUPPORT dovrebbe essere BUILD_opencv_python

+0

Incredibile vedere come i problemi frustranti abbiano soluzioni semplici! (forse è vero anche il contrario!) Grazie! –

Problemi correlati