473,802 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in overloaded operator

93 New Member
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
Nov 22 '07 #1
7 2516
weaknessforcats
9,208 Recognized Expert Moderator Expert
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
Girish Kanakagiri
93 New Member
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 Recognized Expert Moderator Expert
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.
Nov 24 '07 #4
Girish Kanakagiri
93 New Member
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.
Dec 19 '07 #5
weaknessforcats
9,208 Recognized Expert Moderator Expert
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
Girish Kanakagiri
93 New Member
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 Recognized Expert Moderator Expert
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
17880
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. Why can't the = (assignment) operator be overloaded as a friend function ? I work in VS 6.0 ( Win2000 ) as when i referred the MSDN documen'n it said the following :
4
1827
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 memory problem that I'm not readily seeing that lies within the overloaded operator - I think pertaining to the temporary class object that is created and used to return a value of the operands and the pointer variable of the class. Could someone...
1
2227
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 pertaining to casting class A to class B, the implementation of the
14
3663
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 , reinterpret_cast . Theremust be some reason for this restriction for each of the
6
2190
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 Boolean and the main program below. I have overloaded these operator symbols =, ==, !=, !, ||, &&. Now to my question I have some problem with this Class Boolean that I use as
24
2281
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
2295
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 my C++.NET 2.0 textbook does not have one. I tried to build one using the format as taught in my regular C++ book, but I keep getting compiler errors. Some errors claim (contrary to my book) that you cannot use a static function, that you must...
14
2092
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 criteria of sorting. Basically, I would like to sort on visitor count of the Attraction structure. However, it never uses the < overloaded operator with my code. Handler.h:
16
4352
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 <string>
2
2117
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 the overloaded assignment operator function is allowed to be a non- member function then we may be able to write the following: Suppose we have a class Test for which operator+() is defined, suppose we have
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10536
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.