Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice Php 1.0.2 link error

Hi,

I downloaded the new release of ICE and IcePhp. After succeeded in compiling the ICE, I Failed to compile the IcePhp. The compiler is MSVC6.0.

The link errors lare isted:

Linking...
ice.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined in
communicator.obj
ice.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
marshal.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
in communicator.obj
marshal.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
profile.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
in communicator.obj
profile.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
proxy.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined i
n communicator.obj
proxy.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
util.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined in
communicator.obj
util.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
ice.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined i
n communicator.obj; second definition ignored
ice.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
marshal.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defin
ed in communicator.obj; second definition ignored
marshal.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
profile.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defin
ed in communicator.obj; second definition ignored
profile.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
proxy.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
in communicator.obj; second definition ignored
proxy.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
util.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
in communicator.obj; second definition ignored
util.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
Creating library Debug/php_ice.lib and object Debug/php_ice.exp
marshal.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall Slice::ClassDef::isA(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &)const " (__imp_?isA@ClassDe
f@Slice@@QBE_NABV?$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@Z)
marshal.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ice::Object::ice_postUnmarshal(void)" (?ice_postUnmarshal@Object@Ice@@UAEXXZ)
marshal.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ice::Object::ice_preMarshal(void)" (?ice_preMarshal@Object@Ice@@UAEXXZ)
Debug/php_ice.dll : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

php_ice.dll - 14 error(s), 10 warning(s)

Comments

  • maybe it's wrong STL version?

    recommend you rebuild full Ice by youself, because Ice Use stl, maybe your version of stl is not equal to Ice's stl verion.

    on windows, VC 7.1 is better choice, because the stl is compatibile stl standards, but vc 6 's stl is garbage.
  • multiple stl implement?

    seem like your stl is stlport? the stlport include directory must be first in path list.
  • Thanks for your reply.

    I have compiled ICE 1.3 with correct STLPort 4.5.3.
  • maybe need to rebuild all, if not do this.

    .
  • Which version STL Port did you use to compile?
  • on windows, I use Visual C++.NET 2003

    it still works well.
  • if you use VC++ 2003 to build Ice,

    you need not stlport. because stl in VC++ 2003 is followed standard .
  • Thank you.

    After I download and compile the new release of STLPort, the number of link errors have reduced to 11.

    The linker always told me redefinition of some STL struct. The errors is followed:

    Configuration: php_ice - Win32 Debug
    Linking...
    ice.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined in
    communicator.obj
    ice.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
    marshal.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
    in communicator.obj
    marshal.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
    profile.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
    in communicator.obj
    profile.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
    proxy.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined i
    n communicator.obj
    proxy.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
    util.obj : error LNK2005: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined in
    communicator.obj
    util.obj : error LNK2005: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj
    ice.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined i
    n communicator.obj; second definition ignored
    ice.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
    marshal.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defin
    ed in communicator.obj; second definition ignored
    marshal.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
    profile.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defin
    ed in communicator.obj; second definition ignored
    profile.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
    proxy.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
    in communicator.obj; second definition ignored
    proxy.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
    util.obj : warning LNK4006: "struct _STL::bidirectional_iterator_tag __cdecl _STL::iterator_category(struct _STL::_List_iterator_base const &)" (?iterator_category@_STL@@YA?AUbidirectional_iterator_tag@1@ABU_List_iterator_base@1@@Z) already defined
    in communicator.obj; second definition ignored
    util.obj : warning LNK4006: "int * __cdecl _STL::distance_type(struct _STL::_List_iterator_base const &)" (?distance_type@_STL@@YAPAHABU_List_iterator_base@1@@Z) already defined in communicator.obj; second definition ignored
    Creating library Debug/php_ice.lib and object Debug/php_ice.exp
    Debug/php_ice.dll : fatal error LNK1169: one or more multiply defined symbols found
    Error executing link.exe.

    php_ice.dll - 11 error(s), 10 warning(s)


    I am confused that I succeeded in compiling ICE1.3 than failed to compile IcePHP 1.0.2. Faint!

    BTW, my compiler is MSVC6.0.

    Any replies are appreciated.

    Regards,
  • mes
    mes California
    Hi,

    We're getting the same link errors, and we're looking into it.

    We honestly didn't expect that many users would be interested in compiling the Ice extension themselves, but would rather prefer to download the precompiled version. This version was compiled with VC7.0 and would require that you install the corresponding VC7.0 Ice binaries, so I realize that could cause some difficulties for you if you also want to use Ice with VC6.

    We'll let you know what we find out.

    Take care,
    - Mark
  • mes
    mes California
    To fix the link errors, edit the file IcePHP-1.0.2/src/ice/ice_common.h and add the line indicated below:
    #include <Ice/Ice.h>
    #include <Slice/Parser.h>  // ADD THIS LINE
    
    I'm still not sure why this is necessary, but I suspect a compiler bug since it compiles fine in VC 7.0 without this change.

    This fix will be included in the next release.

    Take care,
    - Mark
  • Thank you, mes.

    I edited the source code as your suggest. But there is a link error followed by.

    <br/>
    Generating Code...
    Linking...
    Creating library Debug/php_ice.lib and object Debug/php_ice.exp
    profile.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall _STL::_Nondebug_string<char,class _STL::char_traits<char>,class _STL::allocator<char> >::find(char)const " (__imp_?find@?$_Nondebug_string
    @DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@QBEID@Z)
    Debug/php_ice.dll : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    php_ice.dll - 2 error(s), 0 warning(s)
    <br/>

    Regards,
  • I edit the Profile.cpp. I search all senteces include "find" and replace inverted comma with double quotation marks. It links successful. I hope it would work fine.

    Thanks,