Archived

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

Linking Problems: Unresolved external symbol

Hello, I am a new user of Ice and as I was reading through the manual, I was trying out the Printer application. The directions were extremely lucid, and no problems occurred with code compilation.

However, when I got to linking, about 44 errors appeared, when I suddenly remembered that I had forgotten to add IceUtild.lib and Iced.lib(I'm doing a debug version) to Additional Dependencies in Visual Studio 2005.

This removed 34 errors... but 10 errors still remain and I have listed them:

/////////////////////
Error 1 error LNK2001: unresolved external symbol "public: virtual bool __thiscall Demo::Printer::ice_isA(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct Ice::Current const &)const " (?ice_isA@Printer@Demo@@UBE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Z) HelloWorld.obj

Error 4 error LNK2001: unresolved external symbol "public: virtual class IceInternal::Handle<class Ice::Object> __thiscall Demo::Printer::ice_clone(void)const " (?ice_clone@Printer@Demo@@IceInternal@@XZ) HelloWorld.obj

Error 3 error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall Demo::Printer::ice_id(struct Ice::Current const &)const " (?ice_id@Printer@Demo@@UBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Z) HelloWorld.obj

Error 2 error LNK2001: unresolved external symbol "public: virtual class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall Demo::Printer::ice_ids(struct Ice::Current const &)const " (?ice_ids@Printer@Demo@@UBE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@std@@Z) HelloWorld.obj

Error 5 error LNK2001: unresolved external symbol "public: virtual enum IceInternal::DispatchStatus __thiscall Demo::Printer::__dispatch(class IceInternal::Incoming &,struct Ice::Current const &)" (?__dispatch@Printer@Demo@@UAE?AW4DispatchStatus@IceInternal@@Z) HelloWorld.obj

Error 9 error LNK2001: unresolved external symbol "public: virtual void __thiscall Demo::Printer::__read(class IceInternal::BasicStream *,bool)" (?__read@Printer@Demo@@UAEXPAVBasicStream@IceInternal@@_N@Z) HelloWorld.obj

Error 8 error LNK2001: unresolved external symbol "public: virtual void __thiscall Demo::Printer::__read(class IceInternal::Handle<class Ice::InputStream> const &,bool)" (?__read@Printer@Demo@@IceInternal@@_N@Z) HelloWorld.obj

Error 7 error LNK2001: unresolved external symbol "public: virtual void __thiscall Demo::Printer::__write(class IceInternal::BasicStream *)const " (?__write@Printer@Demo@@Z) HelloWorld.obj

Error 6 error LNK2001: unresolved external symbol "public: virtual void __thiscall Demo::Printer::__write(class IceInternal::Handle<class Ice::OutputStream> const &)const " (?__write@Printer@Demo@@Z) HelloWorld.obj

Error 10 fatal error LNK1120: 9 unresolved externals C:\Documents and Settings\Meta\Program\Visual Studio 2005\Projects\Tombs of Tenoch\Ice\HelloWorld\HelloWorld\Debug\HelloWorld.exe 1
///////////////////////

I have looked this problem up and another person had a similar problem:
http://www.zeroc.com/vbulletin/archive/index.php/t-826.html

But the errors he or she had problems with I have already resolved. I can't understand what I did wrong despite the completely CLEAR instructions given in the manual. Hope this is not too simplistic of a problem for a post.

Thanks for your help.

~ Metadragonfire

Comments

  • Hi - at a glance, did you include the slice-generated Printer.cpp in your solution? Looks like stub or proxy code isn't being built/linked... If you haven't added this already, do so (and be sure to configure the cpp file not to use PCH unless you want this - seems like a gotcha for a few ppl).

    You will also want to update your signature to get prompt response from ZeroC staff.

    HTH
  • Problem Resolved

    Haha... yeah I had forgotten to add Printer.cpp to my "Source Files" filter although I had placed in the folder. Thanks for all your help and your recommendation about my signature.

    ~ Rohit