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

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]
Reply With Quote