Home Help Center

Problem linking when migrating to Ice 3.3.1

c_cubec_cube Member Cheung ChauOrganization: TRG Management LPProject: Using Ice to build a SOA applications
:confused:

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

Comments

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Have you cleaned your project? Most likely, a previously compiled object file is still lying around that wasn't recompiled after your upgrade. If that object file contains an external reference to a symbol in the Ice library that has changed, you get that kind of error.

    Make sure that you are starting with a clean slate by removing all previously-compiled object files, and things should work OK.

    Cheers,

    Michi.
  • c_cubec_cube Member Cheung ChauOrganization: TRG Management LPProject: Using Ice to build a SOA applications
    Hi 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
  • RonnieDayRonnieDay Member Ronnie DayOrganization: RBCCMProject: FIC Pricing
    Did you find a resolution to this? I am having the same problem. However I have only ever used ice 3.4.1
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Ronnie,

    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
  • RonnieDayRonnieDay Member Ronnie DayOrganization: RBCCMProject: FIC Pricing
    the error message I am receiving is:


    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 ?
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Ronnie,
    RonnieDay wrote: »

    I am running vs2003 on an xp box. I have also included both iced.lib and iceUtild.lib to the project settings.

    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
  • RonnieDayRonnieDay Member Ronnie DayOrganization: RBCCMProject: FIC Pricing
    I wish it was a typo. I am dealing with legacy software. Is there anyway at all to use vs2003 ?
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Ronnie,

    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
Sign In or Register to comment.