[Jderobot-dev] Problema al compilar Server.cpp

jgandia jaimerodriguezgandia en gmail.com
Mar Feb 26 23:05:46 CET 2013


mi Server.cpp tiene este codigo:

#include <Ice/Ice.h>
#include <Printer.h>
using namespace std;
using namespace Demo;

class PrinterI : public Printer {
public:
    virtual void printString(const string& s,
                             const Ice::Current&);
};

void 
PrinterI::
printString(const string& s, const Ice::Current&)
{
    cout << s << endl;
}

int
main(int argc, char* argv[])
{
    int status = 0;
    Ice::CommunicatorPtr ic;
    try {
        ic = Ice::initialize(argc, argv);
        Ice::ObjectAdapterPtr adapter
            = ic->createObjectAdapterWithEndpoints(
                "SimplePrinterAdapter", "default -p 10000");
        Ice::ObjectPtr object = new PrinterI;
        adapter->add(object,
                     ic->stringToIdentity("SimplePrinter"));
        adapter->activate();
        ic->waitForShutdown();
    } catch (const Ice::Exception& e) {
        cerr << e << endl;
        status = 1;
    } catch (const char* msg) {
        cerr << msg << endl;
        status = 1;
    }
    if (ic) {
        try {
            ic->destroy();
        } catch (const Ice::Exception& e) {
            cerr << e << endl;
            status = 1;
        }
    }
    return status;
}




y mi CMakeList tiene lo siguiente:


cmake_minimum_required(VERSION 2.8)
include(FindPkgConfig)

SET( SOURCE_FILES  Printer.cpp Server.cpp)
SET(INTERFACES_CPP_DIR /usr/local/lib )

include_directories(
	/usr/local/include/jderobot
	/usr/local/lib
	/home/jaime/Escritorio/mirepositorio/pfc-itis/trunk/micomponente

)

SET( CMAKE_CXX_FLAGS "-lIce -lIceUtil" ) # Opciones para el compilador



add_executable (server  ${SOURCE_FILES})

TARGET_LINK_LIBRARIES(server
    ${libglademm_LIBRARIES}
    ${INTERFACES_CPP_DIR}/jderobot/libcolorspacesmm.so
    ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so
    ${INTERFACES_CPP_DIR}/jderobot/libjderobotice.so
    ${INTERFACES_CPP_DIR}/jderobot/libjderobotutil.so
    ${OpenCV_LIBS}
)







Al realizar el make me dice sale un error con 500 lineas. Pongo la primera
que supongo que sera la razon de todas las demas.

CMakeFiles/server.dir/Server.cpp.o: In function `main':
Server.cpp:(.text+0xad): undefined reference to `Ice::initialize(int&,
char**, Ice::InitializationData const&, int)'
Server.cpp:(.text+0x430): undefined reference to `IceUtil::operator<


Es como si no encontrara la libreria de ice. Si hago un  locate
libjderobotice.so sale lo siguiente:

/usr/local/lib/jderobot/libjderobotice.so

y lo tengo incluido en el CMakeLists.txt con    
${INTERFACES_CPP_DIR}/jderobot/libjderobotice.so en target_libraries()



Que ocurre? Saludos!




--
View this message in context: http://jderobot-developer-list.2315034.n4.nabble.com/Problema-al-compilar-Server-cpp-tp4641100.html
Sent from the Jderobot Developer List mailing list archive at Nabble.com.


More information about the Jde-developers mailing list