|
|
|
|||||
|
how to config the environment in VC .NET 2003
I am a novice . i work in VC .NET 2003.
now! i have added "D:\ice1.5.1for 7.0\include" into the directiories for include files and added "D:\ice1.5.1for 7.0\lib" into the directiories for lib files. but what i could do is compiling . i can't link the files. the error messages : icetest error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceUtil::NullHandleException::NullHandleException( char const *,int)" (__imp_??0NullHandleException@IceUtil@@QAE@PBDH@Z) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Ice::NoObjectFactoryException::~NoObjectFactoryExc eption(void)" (__imp_??1NoObjectFactoryException@Ice@@UAE@XZ) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Ice::Object::~Object(void)" (__imp_??1Object@Ice@@UAE@XZ) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Ice::OperationNotExistException::~OperationNotExis tException(void)" (__imp_??1OperationNotExistException@Ice@@UAE@XZ) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall IceDelegate::Ice::Object::~Object(void)" (__imp_??1Object@Ice@IceDelegate@@UAE@XZ) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl IceInternal::decRef(class Ice::Object *)" (__imp_?decRef@IceInternal@@YAXPAVObject@Ice@@@Z) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall IceUtil::GCShared::~GCShared(void)" (__imp_??1GCShared@IceUtil@@UAE@XZ) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl IceInternal::decRef(class Ice::ObjectAdapter *)" (__imp_?decRef@IceInternal@@YAXPAVObjectAdapter@Ic e@@@Z) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl IceInternal::decRef(class IceProxy::Ice::Object *)" (__imp_?decRef@IceInternal@@YAXPAVObject@Ice@IcePr oxy@@@Z) icetest error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl IceInternal::incRef(class Ice::Object *)" (__imp_?incRef@IceInternal@@YAXPAVObject@Ice@@@Z) icetest error LNK2001: unresolved external symbol "public: __thiscall Ice::LocalException::LocalException(class Ice::LocalException const &)" (??0LocalException@Ice@@QAE@ABV01@@Z) icetest error LNK2001: unresolved external symbol "public: __thiscall Ice::MarshalException::MarshalException(class Ice::MarshalException const &)" (??0MarshalException@Ice@@QAE@ABV01@@Z) icetest error LNK2001: unresolved external symbol "public: __thiscall Ice::NoObjectFactoryException::NoObjectFactoryExce ption(class Ice::NoObjectFactoryException const &)" (??0NoObjectFactoryException@Ice@@QAE@ABV01@@Z) icetest error LNK2001: unresolved external symbol "public: __thiscall Ice::OperationNotExistException::OperationNotExist Exception(class Ice::OperationNotExistException const &)" (??0OperationNotExistException@Ice@@QAE@ABV01@@ ~~~ the source files are copies from the instructions . ////////////////////////////////////////////////////////////////////////////////////////////// //Printer.cpp ////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// ///server.cpp /////////////////////////////////////////////////////////////////////////////////////////////// #include "Printer.h" using namespace std; 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, Ice::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) ic->destroy(); return status; } ////////////////////////////////////////////////////////////////////////////////////////////// //Printer.h ////////////////////////////////////////////////////////////////////////////////////////////// // Ice version 1.5.1 // Generated from file `Printer.ice' #ifndef __Printer_h__ #define __Printer_h__ #include <Ice/LocalObjectF.h> #include <Ice/ProxyF.h> #include <Ice/ObjectF.h> #include <Ice/Exception.h> #include <Ice/LocalObject.h> #include <Ice/Proxy.h> #include <Ice/Object.h> #include <Ice/Outgoing.h> #include <Ice/Incoming.h> #include <Ice/Direct.h> #ifndef ICE_IGNORE_VERSION # if ICE_INT_VERSION != 10501 # error Ice version mismatch! # endif #endif namespace IceProxy { class Printer; bool operator==(const Printer&, const Printer&); bool operator!=(const Printer&, const Printer&); bool operator<(const Printer&, const Printer&); } class Printer; bool operator==(const Printer&, const Printer&); bool operator!=(const Printer&, const Printer&); bool operator<(const Printer&, const Printer&); namespace IceInternal { void incRef(::Printer*); void decRef(::Printer*); void incRef(::IceProxy::Printer*); void decRef(::IceProxy::Printer*); } typedef ::IceInternal::Handle< ::Printer> PrinterPtr; typedef ::IceInternal::ProxyHandle< ::IceProxy::Printer> PrinterPrx; void __write(::IceInternal::BasicStream*, const PrinterPrx&); void __read(::IceInternal::BasicStream*, PrinterPrx&); void __write(::IceInternal::BasicStream*, const PrinterPtr&); void __read(::IceInternal::BasicStream*, PrinterPtr&); void __patch__PrinterPtr(void*, ::Ice::ObjectPtr&); namespace IceProxy { class Printer : virtual public ::IceProxy::Ice::Object { public: void printString(const ::std::string&); void printString(const ::std::string&, const ::Ice::Context&); static const ::std::string& ice_staticId(); private: virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM(); virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD(); }; } namespace IceDelegate { class Printer : virtual public ::IceDelegate::Ice::Object { public: virtual void printString(const ::std::string&, const ::Ice::Context&) = 0; }; } namespace IceDelegateM { class Printer : virtual public ::IceDelegate::Printer, virtual public ::IceDelegateM::Ice::Object { public: virtual void printString(const ::std::string&, const ::Ice::Context&); }; } namespace IceDelegateD { class Printer : virtual public ::IceDelegate::Printer, virtual public ::IceDelegateD::Ice::Object { public: virtual void printString(const ::std::string&, const ::Ice::Context&); }; } class Printer : virtual public ::Ice::Object { public: static const ::std::string __ids[2]; virtual bool ice_isA(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) const; virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::Current()) const; virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::Current()) const; static const ::std::string& ice_staticId(); virtual void printString(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal: ispatchStatus ___printString(::IceInternal::Incoming&, const ::Ice::Current&);static ::std::string __all[5]; virtual ::IceInternal: ispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current&);virtual void __write(::IceInternal::BasicStream*) const; virtual void __read(::IceInternal::BasicStream*, bool); }; void __patch__PrinterPtr(void*, ::Ice::ObjectPtr&); #endif |
|
|||||
|
Re: how to config the environment in VC .NET 2003
Quote:
Did you link in ice.lib and iceUtil.lib (which contain the symbols that weren't found)? If not, do this:[list=1][*]Press right mouse button on the project node in the project explorer in VS[*]Select properties[*]In the properties dialog, open the linker branch (click on it)[*]select input (I hope it's correct as I'm using a non-english version here!)[*]under additional dependencies (first item), add 'ice.lib iceUtil.lib'[*]Compile/ Link again your application[/list=1] These error messages should not appear any more. |
|
|||||
|
Quote:
|
|
||||||
|
When you distribute an application, it is recommended to put the DLLs in the same directory as the exe. See http://msdn.microsoft.com/library/de...ic_linking.asp.
This is particularly important if you use IceSSL, since the Intel PRO/Wireless (centrino) software installs old versions of the OpenSSL DLLs in the system32 directory. Cheers, Bernard |
|
|||||
|
Quote:
regs, Stephan |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ice 3.1.0 under VS 2003? | ddunn | Help Center | 2 | 10-23-2006 12:31 PM |
| Using environment variables with config.txt | stephan | Help Center | 1 | 09-25-2006 05:22 PM |
| How can i config the icephp develop environment? | meizhe | Help Center | 2 | 06-12-2006 06:31 AM |
| set config properties w/o config file | dkey | Help Center | 3 | 05-08-2005 06:27 AM |
| icepackregistry --Ice.Config=config | catalin | Help Center | 1 | 10-28-2003 05:38 PM |