Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-26-2004
fw_csha fw_csha is offline
Registered User
 
 
Join Date: Sep 2004
Posts: 22
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
Reply With Quote
  #2 (permalink)  
Old 09-26-2004
stephan stephan is offline
Registered User
 
Name: Stephan Stapel
Organization: Stephan Stapel
Project: BristolNG
 
Join Date: Oct 2003
Location: Essen, Germany
Posts: 169
Re: how to config the environment in VC .NET 2003

Quote:
Originally posted by fw_csha
[b]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.
modifying the environment of VS is not sufficient. You will also have to adjust some settings for your project.

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.
Reply With Quote
  #3 (permalink)  
Old 09-26-2004
fw_csha fw_csha is offline
Registered User
 
 
Join Date: Sep 2004
Posts: 22
Talking

3Q~~

success~~


ps:
how to deal with the problem that can't find the iceutil15.dll when i run the *.exe .

must i have to put all .dll files into the same direction of .exe?

or there is another good method to solve the problem ?
Reply With Quote
  #4 (permalink)  
Old 09-26-2004
stephan stephan is offline
Registered User
 
Name: Stephan Stapel
Organization: Stephan Stapel
Project: BristolNG
 
Join Date: Oct 2003
Location: Essen, Germany
Posts: 169
Quote:
must i have to put all .dll files into the same direction of .exe?

or there is another good method to solve the problem ?
as usual, there are two options:[list=1][*]The good one is to add an environmnent variable called ICEDIR which points into e.g. c:\ice-1.5.1 and then to adjust the PATH variable to PATH=%PATH%;%ICEDIR%\bin[*]the easier one is to copy the dlls into e.g. your system directory[/list=1]
Reply With Quote
  #5 (permalink)  
Old 09-27-2004
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
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
Reply With Quote
  #6 (permalink)  
Old 09-27-2004
stephan stephan is offline
Registered User
 
Name: Stephan Stapel
Organization: Stephan Stapel
Project: BristolNG
 
Join Date: Oct 2003
Location: Essen, Germany
Posts: 169
Quote:
Originally posted by bernard
When you distribute an application, it is recommended to put the DLLs in the same directory as the exe.
Sorry, this is true for most cases, but it doesn't work for Windows services as their 'current directory' is not the install directory but rather the system directory!

regs,

Stephan
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -4. The time now is 10:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.