473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Problem in overloaded operator

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
Nov 22 '07 #1
7 2494
weaknessforcats
9,208 Expert Mod 8TB
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?
Nov 22 '07 #2
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.
Nov 23 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
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.
Nov 24 '07 #4
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.
Dec 19 '07 #5
weaknessforcats
9,208 Expert Mod 8TB
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??
Dec 19 '07 #6
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.
Dec 21 '07 #7
weaknessforcats
9,208 Expert Mod 8TB
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??
Dec 21 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Nitin Bhardwaj | last post by:
Thanx in advance for the response... I wanna enquire ( as it is asked many a times in Interviews that i face as an Engg PostGraduate ) about the overloading capability of the C++ Language. ...
4
by: August1 | last post by:
I've written an interface and implementation file along with a client source file that allows the use of an overloaded subtraction operator. However, when using the program, I'm running into a...
1
by: masood.iqbal | last post by:
I have a few questions regarding overloaded typecast operators and copy constructors that I would like an answer for. Thanks in advance. Masood (1) In some examples that I have seen...
14
by: ambar.shome | last post by:
Hi, As you know there are few operators in C++ which cant be overloaded. They are: .., .*, ::, ?: , new , delete , sizeof , typeid , static_casr , dynamic_cast , const_cast ,...
6
by: Tony Johansson | last post by:
Hello Experts! I have the user defined class called Boolean that should be handle all kind of logic expression such as if (a && b && c) or if (!a && b && c) osv I have the class definition...
24
by: Bangalore | last post by:
Hi all, I have a problem in accessing elements using overloaded operator . Consider, const int SIZE=10; int FALSE=0; class Array { private: int x; public:
5
by: raylopez99 | last post by:
I need an example of a managed overloaded assignment operator for a reference class, so I can equate two classes A1 and A2, say called ARefClass, in this manner: A1=A2;. For some strange reason...
14
by: Frank | last post by:
Hello everyone, I am having trouble overloading the < operator for an assignment. I use a struct that contains information and I would like to sort this structure using STL sort with my own...
16
by: EM.Bateman | last post by:
Working on Visual Studio .Net I've implemented a class: #ifndef CONTRIBUTOR_H #define CONTRIBUTOR_H enum Gender {male=1, female, unk}; #include <iostream> #include <iomanip> #include...
2
by: subramanian100in | last post by:
overloaded operator=() -------------------------------- overloaded assignment operator should be a non-static MEMBER function of a class. This ensures that the first operand is an lvalue. If...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.