Results 1 to 5 of 5

Thread: linker error while compiling a demo ICE program

  1. #1
    srujankumar is offline Registered User
    Name: Srujan Chennupati
    Organization: Cat Acadamy
    Project: Monitors services running on target machines
    Join Date
    Nov 2008
    Posts
    2

    linker error while compiling a demo ICE program

    Hi,

    I'm a lecturer in a training institute. I was trying to build a sample code given in one of the documents that I've downloaded from ZeroC site on a Visual Studio 2005 SP1. Following are the linker errors that I'm facing. In one of the previous posts on the forums you've mentioned to change the \clr to none. I've followed the changes suggested yet I'm facing the same errors. Its a very basic application.

    Following is the code that I've written. Pls correct me if I'm wrong some where.

    Printer.ice
    ----------

    module Demo {
    interface Printer {
    void printString(string s);
    };
    };


    ICE_Sample.cpp
    ----------------

    // ICE_Sample.cpp : Defines the entry point for the console application.
    //

    #include <Ice\Ice.h>
    #include "stdafx.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 std::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;
    }

    Following are the errors that I'm facing:

    error LNK2028: unresolved token (0A0000FF) "public: virtual __thiscall IceUtil::Shared::~Shared(void)" (??1Shared@IceUtil@@$$FUAE@XZ) referenced in function "public: __thiscall Demo::Printer::Printer(void)" (??0Printer@Demo@@$$FQAE@XZ) ICE_Sample.obj
    error LNK2028: unresolved token (0A000101) "public: virtual __thiscall IceInternal::GCShared::~GCShared(void)" (??1GCShared@IceInternal@@$$FUAE@XZ) referenced in function "public: __thiscall Demo::Printer::Printer(void)" (??0Printer@Demo@@$$FQAE@XZ) ICE_Sample.obj
    error LNK2028: unresolved token (0A00010E) "public: virtual void __thiscall Ice::Object::__gcReachable(class std::map<class IceInternal::GCShared *,int,struct std::less<class IceInternal::GCShared *>,class std::allocator<struct std:air<class IceInternal::GCShared * const,int> > > &)const " (?__gcReachable@Object@Ice@@$$FUBEXAAV?$map@PAVGCS hared@IceInternal@@HU?$less@PAVGCShared@IceInterna l@@@std@@V?$allocator@U?$pair@QAVGCShared@IceInter nal@@H@std@@@4@@std@@@Z) referenced in function "[thunk]ublic: virtual void __thiscall Ice::Object::__gcReachable`vtordispex{24,12,429496 7292,28}' (class std::map<class IceInternal::GCShared *,int,struct std::less<class IceInternal::GCShared *>,class std::allocator<struct std:air<class IceInternal::GCShared * const,int> > > &)const " (?__gcReachable@Object@Ice@@$$F$R4BI@M@PPPPPPPM@BM @BEXAAV?$map@PAVGCShared@IceInternal@@HU?$less@PAV GCShared@IceInternal@@@std@@V?$allocator@U?$pair@Q AVGCShared@IceInternal@@H@std@@@4@@std@@@Z) ICE_Sample.obj
    error LNK2028: unresolved token (0A00010F) "public: virtual void __thiscall Ice::Object::__gcClear(void)" (?__gcClear@Object@Ice@@$$FUAEXXZ) referenced in function "[thunk]ublic: virtual void __thiscall Ice::Object::__gcClear`vtordispex{24,12,4294967292 ,28}' (void)" (?__gcClear@Object@Ice@@$$F$R4BI@M@PPPPPPPM@BM@AEX XZ) ICE_Sample.obj
    error LNK2028: unresolved token (0A000110) "protected: __thiscall Ice::Object::Object(void)" (??0Object@Ice@@$$FIAE@XZ) referenced in function "public: __thiscall Demo::Printer::Printer(void)" (??0Printer@Demo@@$$FQAE@XZ) ICE_Sample.obj
    error LNK2028: unresolved token (0A000111) "protected: virtual __thiscall Ice::Object::~Object(void)" (??1Object@Ice@@$$FMAE@XZ) referenced in function "public: __thiscall Demo::Printer::Printer(void)" (??0Printer@Demo@@$$FQAE@XZ) ICE_Sample.obj
    error LNK2028: unresolved token (0A000112) "public: __thiscall IceInternal::GCShared::GCShared(void)" (??0GCShared@IceInternal@@$$FQAE@XZ) referenced in function "public: __thiscall Demo::Printer::Printer(void)" (??0Printer@Demo@@$$FQAE@XZ) ICE_Sample.obj
    error LNK2028: unresolved token (0A000146) "public: __thiscall Ice::AdapterNotFoundException::AdapterNotFoundExce ption(void)" (??0AdapterNotFoundException@Ice@@$$FQAE@XZ) referenced in function "void __clrcall `anonymous namespace'::`dynamic initializer for 'void __clrcall Ice::__AdapterNotFoundException_init::A0xbd67f472( void)''(void)" (???__E?A0xbd67f472@__AdapterNotFoundException_ini t@Ice@@YMXXZ@?A0xbd67f472@@$$FYMXXZ) ICE_Sample.obj
    .
    .
    .
    .
    .
    fatal error LNK1120: 73 unresolved externals C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ICE_Sample\Debug\ICE_Sample.exe


    I would appreciate your help in resolving this issue.


    Regards,
    Srujan Chennupati

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    It looks to me you are not linking Ice.lib and IceUtil.lib. Did you look at the setup of the demos that accompany the Ice distribution? That should help you get started with your own project settings.

  3. #3
    srujankumar is offline Registered User
    Name: Srujan Chennupati
    Organization: Cat Acadamy
    Project: Monitors services running on target machines
    Join Date
    Nov 2008
    Posts
    2
    Matthew, your suggestion has worked. I've missed placing the Ice.lib and IceUtil.lib in the project settings. It works fine now.

    I've another question. Can I use the Ice to transfer a few files from windows to Linux client.

  4. #4
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    Yes, Ice can be used to transfer files between Windows and Linux machines (or between any of the platforms/languages that Ice supports). For more info on file transfer you should take a look at this faq and Matthew's article in issue 20 of the newsletter.

  5. #5
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    You might also want to check out IcePatch2, which makes it very easy to keep clients in sync with a master copy of a set of files.

    Cheers,

    Michi.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IceTouch examples Linker error
    By SiegfriedHora in forum Help Center
    Replies: 2
    Last Post: 03-08-2010, 08:49 PM
  2. Run demo program error
    By hero107 in forum Help Center
    Replies: 1
    Last Post: 02-28-2006, 01:59 AM
  3. Compiling Ice-3 error
    By orphean in forum Help Center
    Replies: 13
    Last Post: 01-10-2006, 06:04 AM
  4. Question about the bidir demo program
    By umber in forum Help Center
    Replies: 2
    Last Post: 07-21-2005, 02:16 PM
  5. Linker error while building IceBox
    By georgeal in forum Help Center
    Replies: 2
    Last Post: 03-08-2003, 09:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •