Problem in overloaded operator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Girish Kanakagiri
    New Member
    • May 2007
    • 93

    Problem in overloaded operator

    Hi,

    Can any one please resolve this compilation error it is very urgent.

    ..\DBAccess\Loc alization.cpp(3 81) : error C2593: 'operator + ' is ambiguous

    Error executing cl.exe

    DK_SSE_VCT.dll - 1 error(s), 0 warning(s)

    Actually This was running fine earlier.
    Now the VC++ 6.0 Environment has been
    reset, As VC++ installed in new system & while trying to build I am getting this error. In the old system VC++ has been uninstalled.
    Can any one please tell me to make any settings in the environment, without
    making code change to resolve this error

    Code: ( text )

    1.
    _variant_t fieldValue = pRs->Fields->GetItem(_varia nt_t(fieldCnt))->Value;
    2.
    if (fieldValue.vt & VT_BSTR){
    3.
    wstring fieldValueWithQ uotes = L"'" + (_bstr_t)fieldV alue + L"'"; // This is Line 381
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This compiles and links using Visual Studio.NET 2005:
    [code=cpp]
    int _tmain(int argc, _TCHAR* argv[])
    {
    _variant_t fieldValue;
    wstring str;
    str = L"'" + (_bstr_t)fieldV alue + L"'";
    return 0;
    }
    [/code]

    Have you added comsupp.lib to your project as an additional linker dependency?

    Comment

    • Girish Kanakagiri
      New Member
      • May 2007
      • 93

      #3
      Originally posted by weaknessforcats
      This compiles and links using Visual Studio.NET 2005:
      [code=cpp]
      int _tmain(int argc, _TCHAR* argv[])
      {
      _variant_t fieldValue;
      wstring str;
      str = L"'" + (_bstr_t)fieldV alue + L"'";
      return 0;
      }
      [/code]

      Have you added comsupp.lib to your project as an additional linker dependency?
      Thanks a lot for the reply.
      How to add comsupp.lib to the project as an additional linker dependency?

      I actually tried like this.

      In the Active project, I went to project->settings then in the link tab with the General catagory; I added comsupp.lib in the "Project Options" section but
      I am still getting this error. I am not sure whether these are the steps to add
      linker dependency. Can you please tell me how can I achieve this ?

      Thanks & Regards,
      Girish.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        You have to:
        1) #include <comsupp.h>
        2) Add comsupp.lib as an additional linker dependency:
        Project Properties->Configuratio n Properties->linker->input->addtional dependencies
        3) you may have to specify a path to comsupp.lib by tool->options->Projects and Solutions->VC++ Directories->library files from the drop-down menu in the right pane.

        However, I believe comsupp.lib is a standard .lib and probably all you need do is get it correctly specified as an additional linker input dependency.

        Comment

        • Girish Kanakagiri
          New Member
          • May 2007
          • 93

          #5
          result

          Originally posted by weaknessforcats
          You have to:
          1) #include <comsupp.h>
          2) Add comsupp.lib as an additional linker dependency:
          Project Properties->Configuratio n Properties->linker->input->addtional dependencies
          3) you may have to specify a path to comsupp.lib by tool->options->Projects and Solutions->VC++ Directories->library files from the drop-down menu in the right pane.

          However, I believe comsupp.lib is a standard .lib and probably all you need do is get it correctly specified as an additional linker input dependency.
          Hello,

          I added the comsupp.lib to projects->settings->Link(tab)->Catagory [Input]
          Under Project Options added comsupp.lib at the end.

          Since it is VC++ 6.0; I am nat able to find projects and solutions Under tools->option [for point 3]

          As of now I am still getting the same error

          Please reply me for the same.

          Thanks,
          Girish.
          Last edited by Girish Kanakagiri; Dec 19 '07, 01:36 PM. Reason: in complete

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            Originally posted by Girish Kanakagiri
            I added the comsupp.lib to projects->settings->Link(tab)->Catagory [Input]
            Under Project Options added comsupp.lib at the end.
            OK. But did you also set a path to this library??

            Comment

            • Girish Kanakagiri
              New Member
              • May 2007
              • 93

              #7
              Originally posted by weaknessforcats
              OK. But did you also set a path to this library??
              Hello,

              I had gone to tools->options [in the Directories tab] ShowDirectories for
              selected < Library files>
              and included the path of comsupp.lib the directories listing.

              Is this the one you are asking.

              I am not finding any difference in the error message.

              Thanks & Regards,
              Girish.

              Comment

              • weaknessforcats
                Recognized Expert Expert
                • Mar 2007
                • 9214

                #8
                Yes, that's what I meant.

                Now I don't know what's happening, especially since the code compiles using Visual Studio.NET 2005.

                Other things:
                1) your comsupp.lib is older than mine
                2) have you installed all the services packs on VC 6.0??

                Comment

                Working...