[Jde-dev] makefiles para componentes jderobot

David Lobato dav.lobato en gmail.com
Jue Oct 14 14:10:40 CEST 2010


Si compilo algo parecido tengo la siguiente salida:

g++ -I /home/dlobatol/workspace/jderobot/build/include/jderobot `pkg-config
--cflags opencv` `pkg-config --cflags gtkmm-2.4 libglademm-2.4 gthread-2.0`
  -c -o calibrator.o calibrator.cpp
g++ -I /home/dlobatol/workspace/jderobot/build/include/jderobot `pkg-config
--cflags opencv` `pkg-config --cflags gtkmm-2.4 libglademm-2.4 gthread-2.0`
  -c -o view.o view.cpp
g++ -I /home/dlobatol/workspace/jderobot/build/include/jderobot `pkg-config
--cflags opencv` `pkg-config --cflags gtkmm-2.4 libglademm-2.4 gthread-2.0`
  -c -o controller.o controller.cpp
libtool --mode=link g++ -g -O -o calibrator calibrator.o view.o controller.o
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libJderobotIce.la
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libJderobotUtil.la
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libcolorspacesmm.la/home/dlobatol/workspace/jderobot/build/lib/jderobot/libJderobotInterfaces.la
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libprogeo.la`pkg-config
--libs gtkmm-2.4 libglademm-2.4 gthread-2.0` `pkg-config --libs
opencv` -lgsl -lgslcblas
libtool: link: g++ -g -O -o calibrator calibrator.o view.o controller.o
-pthread
 /home/dlobatol/workspace/jderobot/build/lib/jderobot/libJderobotIce.so
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libJderobotUtil.so
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libcolorspacesmm.so
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libJderobotInterfaces.so
/home/dlobatol/workspace/jderobot/build/lib/jderobot/libprogeo.so /usr/lib/
libglademm-2.4.so /usr/lib/libgtkmm-2.4.so /usr/lib/libglade-2.0.so/usr/lib/
libatkmm-1.6.so /usr/lib/libgdkmm-2.4.so /usr/lib/libgiomm-2.4.so /usr/lib/
libpangomm-1.4.so /usr/lib/libglibmm-2.4.so /usr/lib/libcairomm-1.0.so/usr/lib/
libsigc-2.0.so /usr/lib/libgtk-x11-2.0.so /usr/lib/libxml2.so /usr/lib/
libgdk-x11-2.0.so /usr/lib/libatk-1.0.so /usr/lib/libgio-2.0.so /usr/lib/
libpangoft2-1.0.so /usr/lib/libgdk_pixbuf-2.0.so -lm /usr/lib/
libpangocairo-1.0.so /usr/lib/libcairo.so
/usr/lib/libpango-1.0.so/usr/lib/libfreetype.so -lfontconfig /usr/lib/
libgobject-2.0.so /usr/lib/libgmodule-2.0.so /usr/lib/libgthread-2.0.so -lrt
/usr/lib/libglib-2.0.so -lcv -lhighgui -lcvaux -lml -lcxcore -lgsl
-lgslcblas -pthread -Wl,-rpath
-Wl,/home/dlobatol/workspace/jderobot/build/lib/jderobot -Wl,-rpath
-Wl,/home/dlobatol/workspace/jderobot/build/lib/jderobot


Si te fijas se usa g++ tanto para compilar como para enlazar. En tu salida
sin embargo al enlazar usa cc. No entiendo porque.

Donde estás compilado? Que distribución? Podrías poner la salida del comando
env para ver tus variables de entorno.



2010/10/14 <franciscomiguel.rivas en urjc.es>

> Ahí va:
>
>
> g++
> -I/home/frivas/svn/jderobot/jderobot/branches/5.0/build//include/jderobot
> -I/usr/include/gearbox/ `pkg-config --cflags opencv` `pkg-config --cflags
> gtkmm-2.4 libglademm-2.4 gthread-2.0`   -c -o naobody.o naobody.cpp
>
> cc `pkg-config --libs gtkmm-2.4 libglademm-2.4 gthread-2.0` `pkg-config
> --libs opencv` -lgsl -lgslcblas  naobody.o   -o naobody
> naobody.o: In function `main':
> naobody.cpp:(.text+0x11c): undefined reference to
> `jderobotice::Application::Application(jderobotice::Component&)'
> naobody.cpp:(.text+0x137): undefined reference to
> `jderobotice::Application::jderobotMain(int, char**)'
> naobody.o: In function `__static_initialization_and_destruction_0(int,
> int)':
> naobody.cpp:(.text+0x1f9): undefined reference to
> `IceInternal::FactoryTable::FactoryTable()'
> naobody.cpp:(.text+0x1fe): undefined reference to
> `IceInternal::FactoryTable::~FactoryTable()'
> naobody.cpp:(.text+0x227): undefined reference to
> `Ice::AdapterNotFoundException::~AdapterNotFoundException()'
> naobody.cpp:(.text+0x250): undefined reference to
> `jderobot::JderobotException::~JderobotException()'
> naobody.cpp:(.text+0x279): undefined reference to
> `IceStorm::LinkExists::~LinkExists()'
> naobody.o: In function `IceUtil::Shared::~Shared()':
>
>
>
>
> "David Lobato" <dav.lobato en gmail.com> escribió:
>
>  Quiero ver la salida completa. Cárgate el .o y haz el make otra vez para
>> que
>> se compile el .cpp
>>
>>
>>
>> 2010/10/14 <franciscomiguel.rivas en urjc.es>
>>
>>  Buenas,
>>> si si, si hago todo eso.. algo se me esta escapando. Te mando los pasos:
>>> pwd
>>> /home/frivas/svn/jderobot/jderobot/branches/5.0
>>>
>>> ./configure --prefix=`pwd`/build --disable-component-recordingserver
>>> SLICEDIR=/usr/share/Ice-3.3.1/slice/
>>> make
>>> make install
>>>
>>>
>>> me meto en la carpeta donde esta mi componente y ejecuto el make.
>>>
>>> JDEROBOTDIR=/home/frivas/svn/jderobot/jderobot/branches/5.0/build/ make
>>>
>>>
>>>
>>> cc `pkg-config --libs gtkmm-2.4 libglademm-2.4 gthread-2.0` `pkg-config
>>> --libs opencv` -lgsl -lgslcblas  naobody.o   -o naobody
>>> naobody.o: In function `main':
>>> naobody.cpp:(.text+0x11c): undefined reference to
>>> `jderobotice::Application::Application(jderobotice::Component&)'
>>> naobody.cpp:(.text+0x137): undefined reference to
>>> `jderobotice::Application::jderobotMain(int, char**)'
>>> naobody.o: In function `__static_initialization_and_destruction_0(int,
>>> int)':
>>> naobody.cpp:(.text+0x1f9): undefined reference to
>>> `IceInternal::FactoryTable::FactoryTable()'
>>> naobody.cpp:(.text+0x1fe): undefined reference to
>>> `IceInternal::FactoryTable::~FactoryTable()'
>>> naobody.cpp:(.text+0x227): undefined reference to
>>> `Ice::AdapterNotFoundException::~AdapterNotFoundException()'
>>> naobody.cpp:(.text+0x250): undefined reference to
>>> `jderobot::JderobotException::~JderobotException()'
>>> naobody.cpp:(.text+0x279): undefined reference to
>>> `IceStorm::LinkExists::~LinkExists()'
>>>
>>> ........
>>>
>>> No veo donde esta el fallo...
>>>
>>>
>>>
>>> "David Lobato" <dav.lobato en gmail.com> escribió:
>>>
>>>  Ojo, que JDEROBOTDIR debe apuntar al directorio de instalación y no al
>>>
>>>> directorio fuente. Es decir, a aquel directorio en el que al hacer make
>>>> install va todo.
>>>>
>>>> Por ejemplo si hicimos un configure con:
>>>>
>>>> $> pwd
>>>> /home/dlobato/worspace/jderobot
>>>> $> ./configure --prefix=`pwd`/build
>>>>
>>>> entonces JDEROBOTDIR=/home/dlobato/worspace/jderobot/build
>>>>
>>>>
>>>> 2010/10/14 <franciscomiguel.rivas en urjc.es>
>>>>
>>>>  Buenas,
>>>>
>>>>> si, tengo a JDEROBOTDIR apuntado al directorio de instalación de JDE he
>>>>> usado:
>>>>>
>>>>> JDEROBOTDIR=<path> make (JDEROBOTDIR=/home/frivas/jde-5.0/ make)
>>>>>
>>>>> pero lo había probado de las tres formas y nada
>>>>>
>>>>>
>>>>> alguna otra idea?
>>>>>
>>>>>
>>>>>
>>>>> "David Lobato" <dav.lobato en gmail.com> escribió:
>>>>>
>>>>>  Hola Francisco,
>>>>>
>>>>>
>>>>>> recuerda que tienes que declarar la variable JDEROBOTDIR con el
>>>>>> directorio
>>>>>> donde instalaste jderobot.
>>>>>>
>>>>>> Puedes hacerlo de tres maneras:
>>>>>>
>>>>>>  1. Definirla directamente en el Makefile JDEROBOTDIR=<path>
>>>>>>  2. Definirla como variable de entorno
>>>>>>  3. Pasarsela al make al ejecuralo: $> JDEROBOTDIR=<path> make
>>>>>>
>>>>>>
>>>>>> Espero que eso solucione los problemas.
>>>>>>
>>>>>> Un saludo,
>>>>>> David.
>>>>>>
>>>>>> 2010/10/13 <franciscomiguel.rivas en urjc.es>
>>>>>>
>>>>>>  Buenas,
>>>>>>
>>>>>>  estoy intentando compilar un componente que estoy haciendo, al
>>>>>>> intentarlo
>>>>>>> compilar desde el Makefile me salen una lista de dependencias que no
>>>>>>> están
>>>>>>> definidas...
>>>>>>>
>>>>>>> Mi Makefile:
>>>>>>>
>>>>>>> CXXFLAGS = -I$(JDEROBOTDIR)/include/jderobot
>>>>>>> -I/usr/local/include/gearbox/
>>>>>>> `pkg-config --cflags opencv` `pkg-config --cflags gtkmm-2.4
>>>>>>> libglademm-2.4
>>>>>>> gthread-2.0`
>>>>>>>
>>>>>>> LDFLAGS = `pkg-config --libs gtkmm-2.4 libglademm-2.4 gthread-2.0`
>>>>>>> `pkg-config --libs opencv` -lgsl -lgslcblas
>>>>>>> LDADD = $(JDEROBOTDIR)/lib/jderobot/libJderobotIce.la \
>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libJderobotUtil.la \
>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libcolorspacesmm.la \
>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libJderobotInterfaces.la \
>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libprogeo.la
>>>>>>>
>>>>>>> naobody: naobody.o
>>>>>>>     libtool --mode=link g++ -g -O -o naobody naobody.o $(LDADD)
>>>>>>> $(LDFLAGS)
>>>>>>>
>>>>>>> clean:
>>>>>>>     rm -rf *.o
>>>>>>>
>>>>>>> Errores:
>>>>>>> cc `pkg-config --libs gtkmm-2.4 libglademm-2.4 gthread-2.0`
>>>>>>> `pkg-config
>>>>>>> --libs opencv` -lgsl -lgslcblas  naobody.o   -o naobody
>>>>>>> naobody.o: In function `main':
>>>>>>> naobody.cpp:(.text+0x11c): undefined reference to
>>>>>>> `jderobotice::Application::Application(jderobotice::Component&)'
>>>>>>> naobody.cpp:(.text+0x137): undefined reference to
>>>>>>> `jderobotice::Application::jderobotMain(int, char**)'
>>>>>>> naobody.o: In function
>>>>>>> `__static_initialization_and_destruction_0(int,
>>>>>>> int)':
>>>>>>> naobody.cpp:(.text+0x1f9): undefined reference to
>>>>>>> `IceInternal::FactoryTable::FactoryTable()'
>>>>>>> naobody.cpp:(.text+0x1fe): undefined reference to
>>>>>>> `IceInternal::FactoryTable::~FactoryTable()'
>>>>>>> naobody.cpp:(.text+0x227): undefined reference to
>>>>>>> `Ice::AdapterNotFoundException::~AdapterNotFoundException()'
>>>>>>> naobody.cpp:(.text+0x250): undefined reference to
>>>>>>> `jderobot::JderobotException::~JderobotException()'
>>>>>>> naobody.cpp:(.text+0x279): undefined reference to
>>>>>>> `IceStorm::LinkExists::~LinkExists()'
>>>>>>>
>>>>>>> ¿veis algo que pueda faltar?
>>>>>>>
>>>>>>> Si lo compilo desde autotools en la cadena de jde no tengo
>>>>>>> problemas..
>>>>>>> pero
>>>>>>> como mas adelante necesitaré usar librerías que no están dentro de la
>>>>>>> cadena
>>>>>>> (naoqi) necesito compilarlo desde un Makefile,
>>>>>>>
>>>>>>> ¿alguna idea?
>>>>>>>
>>>>>>> Gracias de antemano,
>>>>>>> Fran
>>>>>>>
>>>>>>>
>>>>>>> "David Lobato" <dav.lobato en gmail.com> escribió:
>>>>>>>
>>>>>>>
>>>>>>>  Hola,
>>>>>>>
>>>>>>>
>>>>>>>  Os adjunto un ejemplo de Makefile para compilar un componente para
>>>>>>>> jderobot
>>>>>>>> sin tener que añadirlo al arbol de jderobot. De esta manera en los
>>>>>>>> inicios
>>>>>>>> de los componentes que vayamos desarrollando no tenemos que
>>>>>>>> complicarnos
>>>>>>>> la
>>>>>>>> vida con configures o makefiles.am
>>>>>>>>
>>>>>>>> La idea es que una vez instalado jderobot en nuestro sistema podemos
>>>>>>>> enlazar
>>>>>>>> con sus librerías, al igual que lo haríamos con otros proyectos
>>>>>>>> (opencv,gtk,..)
>>>>>>>>
>>>>>>>> El ejemplo sería así:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> CXXFLAGS = -I $(JDEROBOTDIR)/include/jderobot `pkg-config --cflags
>>>>>>>> opencv`
>>>>>>>> `pkg-config --cflags gtkmm-2.4 libglademm-2.4 gthread-2.0`
>>>>>>>> LDFLAGS = `pkg-config --libs gtkmm-2.4 libglademm-2.4 gthread-2.0`
>>>>>>>> `pkg-config --libs opencv` -lgsl -lgslcblas
>>>>>>>> LDADD = $(JDEROBOTDIR)/lib/jderobot/libJderobotIce.la \
>>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libJderobotUtil.la \
>>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libcolorspacesmm.la \
>>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libJderobotInterfaces.la \
>>>>>>>>     $(JDEROBOTDIR)/lib/jderobot/libprogeo.la
>>>>>>>>
>>>>>>>> calibrator: calibrator.o view.o controller.o
>>>>>>>>     libtool --mode=link g++ -g -O -o calibrator calibrator.o view.o
>>>>>>>> controller.o $(LDADD) $(LDFLAGS)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>>> En este ejemplo estoy compilando el componente calibrator que se
>>>>>>>> crea
>>>>>>>> desde
>>>>>>>> los tres objetos indicados. Estos se compilan con una regla
>>>>>>>> implicita
>>>>>>>> de
>>>>>>>> make.
>>>>>>>> Para inicializar la variable JDEROBOTDIR, que es el lugar donde
>>>>>>>> hemos
>>>>>>>> instalado jderobot, podemos bien declarar la variable de entorno
>>>>>>>> bien
>>>>>>>> pasarsela a make con:
>>>>>>>>
>>>>>>>> $> JDEROBOTDIR=path-jderobot make
>>>>>>>>
>>>>>>>> Y con esto generaremos el ejecutable calibrator con todas sus
>>>>>>>> librerías
>>>>>>>> dinámicas al alcance (no mas LDLIBRARYPATH!!)
>>>>>>>>
>>>>>>>> Espero que sea de ayuda,
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> David Lobato Bravo
>>>>>>>>
>>>>>>>> Universidad Rey Juan Carlos
>>>>>>>> c/Tulipan s/n
>>>>>>>> 28933 Móstoles
>>>>>>>> Madrid, Spain
>>>>>>>> http://jderobot.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>> David Lobato Bravo
>>>>>>
>>>>>> Universidad Rey Juan Carlos
>>>>>> c/Tulipan s/n
>>>>>> 28933 Móstoles
>>>>>> Madrid, Spain
>>>>>> http://jderobot.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>> --
>>>> David Lobato Bravo
>>>>
>>>> Universidad Rey Juan Carlos
>>>> c/Tulipan s/n
>>>> 28933 Móstoles
>>>> Madrid, Spain
>>>> http://jderobot.org
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> David Lobato Bravo
>>
>> Universidad Rey Juan Carlos
>> c/Tulipan s/n
>> 28933 Móstoles
>> Madrid, Spain
>> http://jderobot.org
>>
>>
>
>


-- 
David Lobato Bravo

Universidad Rey Juan Carlos
c/Tulipan s/n
28933 Móstoles
Madrid, Spain
http://jderobot.org
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://gsyc.escet.urjc.es/pipermail/jde-developers/attachments/20101014/0fce0cd0/attachment-0001.htm 


More information about the Jde-developers mailing list