Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem in overloaded operator

Member
 
Join Date: May 2007
Posts: 83
#1: Nov 22 '07
Hi,

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

..\DBAccess\Localization.cpp(381) : 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(_variant_t(fieldCnt))->Value;
2.
if (fieldValue.vt & VT_BSTR){
3.
wstring fieldValueWithQuotes = L"'" + (_bstr_t)fieldValue + L"'"; // This is Line 381

Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,382
#2: Nov 22 '07

re: Problem in overloaded operator


This compiles and links using Visual Studio.NET 2005:
Expand|Select|Wrap|Line Numbers
  1. int _tmain(int argc, _TCHAR* argv[])
  2. {
  3.     _variant_t fieldValue;
  4.     wstring str;
  5.     str = L"'" + (_bstr_t)fieldValue + L"'"; 
  6.     return 0;
  7. }
  8.  
Have you added comsupp.lib to your project as an additional linker dependency?
Member
 
Join Date: May 2007
Posts: 83
#3: Nov 23 '07

re: Problem in overloaded operator


Quote:

Originally Posted by weaknessforcats

This compiles and links using Visual Studio.NET 2005:

Expand|Select|Wrap|Line Numbers
  1. int _tmain(int argc, _TCHAR* argv[])
  2. {
  3.     _variant_t fieldValue;
  4.     wstring str;
  5.     str = L"'" + (_bstr_t)fieldValue + L"'"; 
  6.     return 0;
  7. }
  8.  
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.
Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,382
#4: Nov 24 '07

re: Problem in overloaded operator


You have to:
1) #include <comsupp.h>
2) Add comsupp.lib as an additional linker dependency:
Project Properties->Configuration 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.
Member
 
Join Date: May 2007
Posts: 83
#5: Dec 19 '07

re: Problem in overloaded operator


Quote:

Originally Posted by weaknessforcats

You have to:
1) #include <comsupp.h>
2) Add comsupp.lib as an additional linker dependency:
Project Properties->Configuration 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.
Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,382
#6: Dec 19 '07

re: Problem in overloaded operator


Quote:

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??
Member
 
Join Date: May 2007
Posts: 83
#7: Dec 21 '07

re: Problem in overloaded operator


Quote:

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.
Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,382
#8: Dec 21 '07

re: Problem in overloaded operator


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??
Reply