[Jde-dev] makefiles para componentes jderobot
franciscomiguel.rivas en urjc.es
franciscomiguel.rivas en urjc.es
Jue Oct 14 13:53:00 CEST 2010
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
>
More information about the Jde-developers
mailing list