Problem linking when migrating to Ice 3.3.1

in Help Center

I got linking error when building my Ice-related project in VC 2003 using Ice 3.3.1 and here is one of the sample error
Linking...
Creating library ..\Lib\TRGTimeSeries-mt-1_0.lib and object ..\Lib\TRGTimeSeries-mt-1_0.exp
TRGIceStubs-mt.lib(dsl.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl IceInternal::LocalExceptionWrapper::throwWrapper(class exception const &)" ([email protected]@[email protected]@Z)
If I switch it back to Ice-3.2.1. everything works fine. Any Idea?
Thx
c_cube
0
Comments
Make sure that you are starting with a clean slate by removing all previously-compiled object files, and things should work OK.
Cheers,
Michi.
Thank you for taking the time responding to my post. Yes, I did clean all projects and did a rebuild all in VC 2003.
One thing I notice is that IceInternal::LocalExceptionWrapper::throwWrapper is a method got added to Ice 3.3.1. I know that because I have compared the output of slice2cpp. I was able to compare all my ice file into cpp and header file and generated obj files and link them into a lib (let's call it icestubs.lib)
The error stated in my original post occurs when other projects are trying to reference icestubs.lib in the linking process.
How to confirm the method exists in ice.lib and iceutil.lib in my C:\Ice-3.3.1\lib folder? Thank you for your help again
c_cube
Can you paste the error message you're getting, and also include information about your environment (Visual Studio version, debug or release, Win32/x64 target etc.)?
Maybe we'll be able to spot the issue.
All the best,
Bernard
felixExample error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl IceInternal::LocalExceptionWrapper::throwWrapper(class exception const &)" ([email protected]@[email protected]@Z) referenced in function [email protected]@[email protected]@[email protected]@[email protected]@[email protected]@UAE[email protected]@[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@00PBV[email protected][email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected][email protected][email protected][email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z$0
I am using this as my ice file:
#ifndef AURORA_ICE
#define AURORA_ICE
//
module com
{
module rbccm
{
module aurora
{
module pricing
{
module service
{
module DieselServiceModule
{
enum DieselErrorEnum { InstrumentNotFound, UserNotFound, InvalidUserDataFormat,
UserDataObjectError, NotImplementedError, DieselServiceError, NoProxyError };
exception BaseException {
string reason;
};
exception DieselServiceException extends BaseException {
DieselErrorEnum dieselError;
};
sequence<byte> SdObjectBytes;
dictionary<string, string> DieselAttributeMap;
struct DieselElement
{
string name;
DieselAttributeMap attributeMap;
};
interface DieselService
{
DieselElement getDieselElement(string region, string cacheObjectId, string elementName) throws DieselServiceException;
bool setDieselElement(string region, string cacheObjectId, DieselElement element) throws DieselServiceException;
string getSdObjectXml(string region, string cacheObjectId) throws DieselServiceException;
bool setSdObjectXml(string region, string cacheObjectId, string sdObjectXml) throws DieselServiceException;
SdObjectBytes getDieselObject(string region, string cacheObjectId, string attribute) throws DieselServiceException;
bool setDieselObject(string region, string cacheObjectId, SdObjectBytes sdObject) throws DieselServiceException;
};
};
};
};
};
};
};
//
#endif
and using slice2cpp.exe to generate the cpp code.
I am running vs2003 on an xp box. I have also included both iced.lib and iceUtild.lib to the project settings.
any ideas ?
If that's not a typo, the issue is the version of Visual Studio you're using. With Ice 3.4.1, you need either Visual Studio 2008 or 2010 (for 2010, use lib and bin in the vc100 sub-directory).
Best regards,
Bernard
You could use an old version of Ice with support for Visual Studio 2003:
http://www.zeroc.com/download_3_2_1.html
If you have other Ice components (clients, servers) without this old compiler requirement, I would recommend to use the latest Ice version for them. All versions of Ice inter-operate with each other.
Cheers,
Bernard