<div dir="ltr"><div>Hola,<br><br><div style="margin-left:40px">si, tiene pinta de problema de orden de librerías. Cuando el enlazador requiere que los elementos estén en orden hay que pasárselos en orden de dependencia inverso, es decir, primero los dependientes y luego las dependencias.<br>
</div><div style="margin-left:40px">Si tienes librerías que dependen de Ice, este deberá estar después que las primeras.<br><br></div><div style="margin-left:40px">Lo de utilizar CMAKE_CXX_FLAGS para cargar librerías aún está en algunos y lo desaconsejo, ya que puedes conseguir el mismo efecto - pero más configurable - poniendo las librerías directamente en el TARGET_LINK_LIBRARIES; por ejemplo<br>
<br></div><div style="margin-left:40px"><div style="margin-left:40px">TARGET_LINK_LIBRARIES(<div id=":un">eloyBasicComponent<br>
    ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libjderobotice.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libjderobotutil.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libcolorspaces.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libcvfast.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libcvblob.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libimgAnalyze.so<br>
    ${libglademm_LIBRARIES}<br>
    ${OpenCV_LIBS}<br></div></div></div><div style="margin-left:40px"><div style="margin-left:40px"><div id=":un">    Ice<br></div></div></div><div style="margin-left:40px"><div style="margin-left:40px"><div id=":un">    IceUtil<br>
</div></div></div><div style="margin-left:40px"><div style="margin-left:40px"><div id=":un">
)<br>
</div></div></div><div style="margin-left:40px"><br></div><div style="margin-left:40px">enlazaría Ice e IceUtil colocándolos al final de la lista de elementos a enlazar.<br><br></div><div style="margin-left:40px">También tienes variables que rellena cmake para Ice si llamas a Deps/Ice (creo que hay ejemplos de esto en otros componentes).<br>
</div><br></div>Un saludo,<br><div style="margin-left:40px">Roberto<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/22 Eloy <span dir="ltr">&lt;<a href="mailto:abanibiaboebe@gmail.com" target="_blank">abanibiaboebe@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hola, ya casi estoy acabando de adaptar mi componente a la versión actual de<br>
jderobot.<br>
<br>
Me he encontrado con un error que parece ser de linkado.<br>
<br>
CMakeFiles/eloyBasicComponent.dir/control.cpp.o: In function<br>
`__static_initialization_and_destruction_0(int, int)&#39;:<br>
control.cpp:(.text+0x32f9): undefined reference to<br>
`IceInternal::FactoryTableInit::FactoryTableInit()&#39;<br>
control.cpp:(.text+0x32fe): undefined reference to<br>
`IceInternal::FactoryTableInit::~FactoryTableInit()&#39;<br>
control.cpp:(.text+0x3327): undefined reference to<br>
`Ice::AdapterNotFoundException::~AdapterNotFoundException()&#39;<br>
CMakeFiles/eloyBasicComponent.dir/control.cpp.o: In function<br>
`IceUtil::Shared::~Shared()&#39;:<br>
control.cpp:(.text._ZN7IceUtil6SharedD2Ev[_ZN7IceUtil6SharedD5Ev]+0xb):<br>
undefined reference to `vtable for IceUtil::Shared&#39;<br>
CMakeFiles/eloyBasicComponent.dir/control.cpp.o: In function<br>
`Ice::LocalObject::~LocalObject()&#39;:<br>
control.cpp:(.text._ZN3Ice11LocalObjectD1Ev[Ice::LocalObject::~LocalObject()]+0x17):<br>
undefined reference to `vtable for Ice::LocalObject&#39;<br>
control.cpp:(.text._ZN3Ice11LocalObjectD1Ev[Ice::LocalObject::~LocalObject()]+0x29):<br>
undefined reference to `vtable for Ice::LocalObject&#39;<br>
CMakeFiles/eloyBasicComponent.dir/control.cpp.o: In function<br>
`Ice::ConnectionInfo::ConnectionInfo()&#39;:<br>
control.cpp:(.text._ZN3Ice14ConnectionInfoC1Ev[Ice::ConnectionInfo::ConnectionInfo()]+0x11):<br>
undefined reference to `IceUtil::Shared::Shared()&#39;<br>
<br>
Y sigue asi unas 100 lineas más...<br>
<br>
<br>
<br>
En el CMakeLists.txt tengo:<br>
cmake_minimum_required(VERSION 2.8)<br>
include(FindPkgConfig)<br>
<br>
SET( SOURCE_FILES  control.cpp eloyBasicComponent.cpp api.cpp gui.cpp)<br>
<br>
SET(INTERFACES_CPP_DIR /usr/local/lib )<br>
SET( CMAKE_CXX_FLAGS &quot;-lIce -lIceUtil&quot; ) # Opciones para el compilador<br>
<br>
include_directories(<br>
    ${INTERFACES_CPP_DIR}<br>
    /usr/local/include/jderobot/<br>
)<br>
<br>
<br>
PKG_CHECK_MODULES(gtkmm REQUIRED gtkmm-2.4)<br>
include_directories(${gtkmm_INCLUDE_DIRS})<br>
link_directories(${gtkmm_LIBRARY_DIRS})<br>
<br>
PKG_CHECK_MODULES(gthread REQUIRED gthread-2.0)<br>
include_directories(${gthread_INCLUDE_DIRS})<br>
link_directories(${gthread_LIBRARY_DIRS})<br>
<br>
PKG_CHECK_MODULES(libglademm REQUIRED libglademm-2.4)<br>
include_directories(${libglademm_INCLUDE_DIRS})<br>
link_directories(${libglademm_LIBRARY_DIRS})<br>
<br>
find_package(OpenCV REQUIRED)<br>
<br>
add_executable (eloyBasicComponent  ${SOURCE_FILES})<br>
<br>
TARGET_LINK_LIBRARIES(eloyBasicComponent<br>
    ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libjderobotice.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libjderobotutil.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libcolorspaces.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libcvfast.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libcvblob.so<br>
    ${INTERFACES_CPP_DIR}/jderobot/libimgAnalyze.so<br>
    ${libglademm_LIBRARIES}<br>
    ${OpenCV_LIBS}<br>
)<br>
<br>
<br>
Y en el control.cpp<br>
<br>
#include &lt;Ice/Ice.h&gt;<br>
#include &lt;IceUtil/IceUtil.h&gt;<br>
<br>
<br>
Un saludo.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://jderobot-developer-list.2315034.n4.nabble.com/Ice-undefined-reference-tp4641740.html" target="_blank">http://jderobot-developer-list.2315034.n4.nabble.com/Ice-undefined-reference-tp4641740.html</a><br>

Sent from the Jderobot Developer List mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Jde-developers mailing list<br>
<a href="mailto:Jde-developers@gsyc.es">Jde-developers@gsyc.es</a><br>
<a href="http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers" target="_blank">http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers</a><br>
</blockquote></div><br></div>