[Jderobot-dev] Compilar cameraserver y cameraview

JoseMaria josemaria.plaza en gmail.com
Vie Dic 21 18:32:32 CET 2012


El cmake de estos dos componentes lo tenemos hechos unos zorros, a ver
si lo desenmarañamos. Mis dos centavos:

1-cameraserver es el servidor de imágenes y no debería depender de nada
gráfico puesto que no presenta GUI de ninguna manera, sólo captura
fotogramas y los envía a través de interfaz ICE. libgnomecanvas y
gtkglextmm son dos bibliotecas gráficas.

La mejor manera de construir el CMake.list de un componente es partir de
uno vacío, intentar compilarlo e ir apuntando en los ficheros
respectivos de Cmake/resolviendo las cabeceras y las bibliotecas que
necesita.

2.-cameraview no hace gran cosa con las imágenes. Quizá dependa de
opencv para expresar/almacenar las imágenes que pide a cameraserver. En
ese caso debe depender de opencv-2.4 que es la última de referencia que
tenemos, no? No recuerdo si la dependencia de libcolorspaces es
prescindible.

Para opencv-2.3 funcionará también, porque es parecida. Hubo cambio
grande de la opencv-2.1 a la opencv-2.4 creo recordar, donde empezaron a
usar CvMat para almacenar las imágenes.

Ánimo,

JoseMaria
On Fri, 2012-12-21 at 17:52 +0100, Daniel Castellano wrote:
> Hola,
> 
> Vengo a echar más leña al fuego :P
> 
> Tanto cameraview como cameraserver tienen como requeridas las
> librerías libgnomecanvas y gtkglextmm; lo he comentado con Jose María
> Cañas y no deberían depender de estos paquetes (al menos cameraserver
> seguro que no); no lo cambio yo directamente porque es la primera vez
> que me meto con esto y no quiero pifiarla... XD
> 
> Por otro lado, al hacer el "make" para alguno de estos dos componentes
> (el "cmake ." ya no se me queja), me salta el siguiente error:
> 
> "
> Scanning dependencies of target colorspacesmm
> [ 82%] Building CXX
> object ../../../libs/colorspaces/CMakeFiles/colorspacesmm.dir/imagecv.cpp.o
> In file included from /usr/local/include/opencv2/core/core.hpp:49,
> 
>  from /usr/local/include/opencv2/highgui/highgui.hpp:46,
> 
>  from /home/drado/jderobot/src/libs/colorspaces/imagecv.cpp:5:
> /usr/local/include/opencv2/core/types_c.h:186: error: redefinition of
> ‘union Cv32suf’
> /usr/local/include/opencv/cxtypes.h:180: error: previous definition of
> ‘union Cv32suf’
> /usr/local/include/opencv2/core/types_c.h:192: error: invalid type in
> declaration before ‘;’ token
> /usr/local/include/opencv2/core/types_c.h:192: error: conflicting
> declaration ‘typedef int Cv32suf’
> /usr/local/include/opencv/cxtypes.h:185: error: ‘Cv32suf’ has a
> previous declaration as ‘typedef union Cv32suf Cv32suf’
> /usr/local/include/opencv2/core/types_c.h:194: error: redefinition of
> ‘union Cv64suf’
> /usr/local/include/opencv/cxtypes.h:188: error: previous definition of
> ‘union Cv64suf’
> /usr/local/include/opencv2/core/types_c.h:200: error: invalid type in
> declaration before ‘;’ token
> /usr/local/include/opencv2/core/types_c.h:200: error: conflicting
> declaration ‘typedef int Cv64suf’
> /usr/local/include/opencv/cxtypes.h:193: error: ‘Cv64suf’ has a
> previous declaration as ‘typedef union Cv64suf Cv64suf’
> /usr/local/include/opencv2/core/types_c.h:205: error: expected
> identifier before numeric constant
> /usr/local/include/opencv2/core/types_c.h:205: error: expected ‘}’
> before numeric constant
> /usr/local/include/opencv2/core/types_c.h:205: error: expected
> unqualified-id before numeric constant
> /usr/local/include/opencv2/core/types_c.h:256: error: expected
> declaration before ‘}’ token
> make[2]: ***
> [../../../libs/colorspaces/CMakeFiles/colorspacesmm.dir/imagecv.cpp.o]
> Error 1
> make[1]: ***
> [../../../libs/colorspaces/CMakeFiles/colorspacesmm.dir/all] Error 2
> make: *** [all] Error 2
> "
> 
> Por lo que veo, el error viene al referenciar en colorspaces librerías
> de openCV y openCV2, según hablé con Jose María, no debería
> referenciarse nada de opencv, sólo openCV2
> 
> He buscado y en "[trunk]/src/libs/colorspaces/imagecv.cpp" se incluye
> la librería <opencv2/highgui/highgui.hpp> y en
> "[trunk]/src/libs/colorspaces/imagecv.h" se incluye la librería
> <opencv/cv.h>, que es la que creo que no se debería referenciar; por
> supuesto, al intentar la brutalidad de cambiar esta última librería
> por la equivalente a la primera (opencv2/highgui/highgui_c.h) se queja
> de que hay funciones y tipos no definidos.
> 
> Como apunte, estoy en un Ubuntu 10.04.4 LTS con amd64 y tengo
> instalado openCV 2.0.0 y 2.3.1 (las que vienen en el manual)
> 
> Un saludo, Daniel.
> 
> El día 21 de diciembre de 2012 14:06, gallardo agustin
> <agallard4 en gmail.com> escribió:
> >
> > Buenos días,
> >
> >
> > he ejecutado los comandos y limpiado los directorios pero continuo
> con el
> > mismo error.
> >
> > Estoy con la versión 4.4.7 de gcc y g++.
> >
> >
> >
> > Un saludo y muchas gracias,
> > Agustín
> >
> > 2012/12/21 Luis Roberto Morales <lr.morales.iglesias en gmail.com>
> >>
> >> Buenas noches,
> >>
> >> he probado a compilar ambos componentes con gcc-4.6 (ubuntu 12.10
> amd64) y
> >> sólo me ha saltado el error de enlazado con dc1394 (referencia a
> >> dc1394_video_set_transmission desde cameraserver.cpp.o), que se ha
> >> solucionado al mover las órdenes de enlace desde CMAKE_CXX_FLAGS a
> >> TARGET_LINK_LIBRARIES en el CMakeLists.txt de cameraserver. Lo he
> probado
> >> con una cámara web USB y los componentes parecen funcionar
> correctamente.
> >>
> >>
> >> En cuanto al tema de cambiar la versión de gcc, he encontrado unas
> >> instrucciones [1] que mediante el uso de update-alternatives
> permiten
> >> cambiar entre versiones de gcc y g++ más rápidamente. Para aquellas
> personas
> >> que utilicen distintas versiones habitualmente creo que les puede
> resultar
> >> interesante para no tener que rehacer los enlaces simbólicos.
> >>
> >> Un saludo,
> >> Roberto
> >>
> >> [1] http://askubuntu.com/questions/26498/choose-gcc-and-g-version
> >>
> >>
> >> El 20 de diciembre de 2012 18:27, Mikel Gonzalez Baile
> >> <m.gonzalezbai en gmail.com> escribió:
> >>
> >>> Buenas,
> >>>
> >>> prueba a ejecutar estos comandos uno por uno:
> >>>
> >>> sudo apt-get install gcc-4.4
> >>> sudo apt-get install g++-4.4
> >>> sudo cd /usr/bin
> >>> sudo rm gcc
> >>> sudo rm g++
> >>> sudo ln -s gcc-4.4 gcc
> >>> sudo ln -s g++-4.4 g++
> >>>
> >>> Tras esto, no olvides ejecutar los scripts "clean.sh" de cada
> componente
> >>> para realizar una compilación limpia con los nuevos cambios.
> >>>
> >>> Un saludo.
> >>>
> >>> Mikel.
> >>>
> >>>
> >>> 2012/12/20 gallardo agustin <agallard4 en gmail.com>
> >>>>
> >>>>
> >>>> Hola Mikel,
> >>>>
> >>>> antes de anada muchas gracias.
> >>>>
> >>>> Ahora obtengo casi el mismo error en cameraview y cameraserver:
> >>>>
> >>>> Cameraserver:
> >>>> [100%] Building CXX object
> >>>> ../CMakeFiles/cameraserver.dir/gstpipeline.cpp.o
> >>>> Linking CXX executable cameraserver
> >>>> build/../../../libs/jderobotice/libjderobotice.so: error:
> undefined
> >>>> reference to 'vtable for Glacier2::CannotCreateSessionException'
> >>>> build/../../../libs/jderobotice/libjderobotice.so: error:
> undefined
> >>>> reference to
> >>>>
> 'Glacier2::CannotCreateSessionException::~CannotCreateSessionException()'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_init'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_settype'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_setprotocol'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> CMakeFiles/cameraserver.dir/cameraserver.cpp.o:cameraserver.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> >>>> collect2: ld returned 1 exit status
> >>>> make[2]: *** [../cameraserver] Error 1
> >>>> make[1]: *** [../CMakeFiles/cameraserver.dir/all] Error 2
> >>>> make: *** [all] Error 2
> >>>>
> >>>>
> >>>> CameraView
> >>>> [100%] Building CXX
> object ../CMakeFiles/cameraview.dir/viewer.cpp.o
> >>>> Linking CXX executable cameraview
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_init'
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_settype'
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_setprotocol'
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> CMakeFiles/cameraview.dir/cameraview.cpp.o:cameraview.cpp:function
> >>>> IceUtil::Mutex::init(IceUtil::MutexProtocol): error: undefined
> reference to
> >>>> 'pthread_mutexattr_destroy'
> >>>>
> >>>> collect2: ld returned 1 exit status
> >>>> make[2]: *** [../cameraview] Error 1
> >>>> make[1]: *** [../CMakeFiles/cameraview.dir/all] Error 2
> >>>> make: *** [all] Error 2
> >>>>
> >>>>
> >>>>
> >>>> Un saludo y muchas gracias,
> >>>> Agustín
> >>>>
> >>>>
> >>>> 2012/12/20 Mikel Gonzalez Baile <m.gonzalezbai en gmail.com>
> >>>>>
> >>>>> Buenas,
> >>>>>
> >>>>> he modificado el CMakeLists.txt del componente cameraserver
> eliminando
> >>>>> la dependencia a la librería visionlib la cual creo que no es
> necesaria para
> >>>>> este componente. Prueba a hacer un update en ese directorio para
> actualizar
> >>>>> los cambios en tu copia local.
> >>>>>
> >>>>> También he modificado el CMakeLists.txt del componente
> cameraview para
> >>>>> que enlace de forma correcta con OpenCV, prueba a ver con los
> nuevos
> >>>>> cambios.
> >>>>>
> >>>>> Un saludo.
> >>>>>
> >>>>> Mikel.
> >>>>>
> >>>>>
> >>>>> On 20 December 2012 16:41, gallardo agustin
> <agallard4 en gmail.com>
> >>>>> wrote:
> >>>>>>
> >>>>>>
> >>>>>> Buenos días,
> >>>>>>
> >>>>>> no consigo comprilar diferentes componentes de jderobot:
> >>>>>>
> >>>>>> Con cameraserver obtengo el siguiente error:
> >>>>>>
> >>>>>> [ 98%] Built target visionlib
> >>>>>> Linking CXX executable cameraserver
> >>>>>> /usr/bin/ld: CMakeFiles/cameraserver.dir/cameraserver.cpp.o:
> undefined
> >>>>>> reference to symbol 'dc1394_video_set_transmission'
> >>>>>> /usr/bin/ld: note: 'dc1394_video_set_transmission' is defined
> in DSO
> >>>>>> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libdc1394.so so try
> >>>>>> adding it to the linker command line
> >>>>>> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libdc1394.so:
> >>>>>> could not read symbols: Invalid operation
> >>>>>> collect2: ld returned 1 exit status
> >>>>>> make[2]: *** [../cameraserver] Error 1
> >>>>>> make[1]: *** [../CMakeFiles/cameraserver.dir/all] Error 2
> >>>>>> make: *** [all] Error 2
> >>>>>>
> >>>>>> Con cameraview:
> >>>>>>
> >>>>>> Linking CXX executable cameraview
> >>>>>> CMakeFiles/cameraview.dir/cameraview.cpp.o: In function
> >>>>>> `cv::Mat::~Mat()':
> >>>>>> cameraview.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x2b):
> undefined
> >>>>>> reference to `cv::fastFree(void*)'
> >>>>>> CMakeFiles/cameraview.dir/cameraview.cpp.o: In function
> >>>>>> `cv::Mat::release()':
> >>>>>>
> cameraview.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x3b):
> >>>>>> undefined reference to `cv::Mat::deallocate()'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::cvtColor(cv::_InputArray const&,
> >>>>>> cv::_OutputArray const&, int, int)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::copySize(cv::Mat const&)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to
> `cv::_OutputArray::_OutputArray(cv::Mat&)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::copyTo(cv::_OutputArray
> const&) const'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::imwrite(std::basic_string<char,
> >>>>>> std::char_traits<char>, std::allocator<char> > const&,
> cv::_InputArray
> >>>>>> const&, std::vector<int, std::allocator<int> > const&)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::_InputArray::_InputArray(cv::Mat
> const&)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::reshape(int, int, int const*)
> const'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::mixChannels(cv::Mat const*,
> unsigned int,
> >>>>>> cv::Mat*, unsigned int, int const*, unsigned int)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::zeros(int, int, int)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::create(int, int const*, int)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::imread(std::basic_string<char,
> >>>>>> std::char_traits<char>, std::allocator<char> > const&, int)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `vtable for cv::_OutputArray'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::operator=(cv::Scalar_<double>
> const&)'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `cv::Mat::convertTo(cv::_OutputArray
> const&, int,
> >>>>>> double, double) const'
> >>>>>>
> >>>>>> /home/caupolican/robotica/trunk/src/components/cameraview/build/../../../libs/colorspaces/libcolorspacesmm.so:
> >>>>>> undefined reference to `vtable for cv::_InputArray'
> >>>>>> collect2: ld returned 1 exit status
> >>>>>> make[2]: *** [../cameraview] Error 1
> >>>>>> make[1]: *** [../CMakeFiles/cameraview.dir/all] Error 2
> >>>>>> make: *** [all] Error 2
> >>>>>>
> >>>>>>
> >>>>>> Estoy instalando sobre Ubuntu 12.04. Inicialmente instalé
> OpenCV 2.3.1
> >>>>>> (¿ cuál es la mejor manera de desinstalarlo ?) pero luego he
> instalado
> >>>>>> también 2.4.3. y sigue sin funcionar, tras ejecutar "make
> clean" y los
> >>>>>> scripts "clean.sh"
> >>>>>>
> >>>>>>
> >>>>>> Un saludo y
> >>>>>> Gracias!
> >>>>>>
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> Jde-developers mailing list
> >>>>>> Jde-developers en gsyc.es
> >>>>>>
> http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Jde-developers mailing list
> >>> Jde-developers en gsyc.es
> >>> http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers
> >>>
> >>
> >>
> >> _______________________________________________
> >> Jde-developers mailing list
> >> Jde-developers en gsyc.es
> >> http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers
> >>
> >
> >
> > _______________________________________________
> > Jde-developers mailing list
> > Jde-developers en gsyc.es
> > http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers
> >
> 
> _______________________________________________
> Jde-developers mailing list
> Jde-developers en gsyc.es
> http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers

-- 
http://gsyc.es/jmplaza 
Universidad Rey Juan Carlos




More information about the Jde-developers mailing list