Click to See Complete Forum and Search --> : Code which compiles in VC++6 won't in VC++.NET


Jeff Ulrich
September 24th, 2002, 11:08 PM
I recently upgraded to VC++.NET

I had been working with VC6 for quite some time , and I never had any problems building our C++ libraries.

However, in VC++.NET, the compilation chokes. In particular, it pukes on the following line of code, or variants therof:


int operator==(const TradeRecords &rec1, const TradeRecords &rec2)

with the message
"error C2733: second C linkage of overloaded function 'operator`=='' not allowed"

It fails on other operator== lines as well, in such standard classes as Guiddef.h.

I think it might have something to do with including the <afxwin.h> header file (for purposes of getting CString), but I'm not sure. Could precompiled headers have anything to do with this?

I really am at a loss and appreciate any ideas people have out there. I'm about ready to toss my PC out the window to see if the code works better out there.

Thanks for any replies,
Jeff

djbass
September 25th, 2002, 11:45 AM
I tried the migration from VC6 to VC .Net too. It tried it for a while, and couldn't get it to compile with even the simple MFC apps that VC6 generated, never mind the 100k line projects I've got...

Am I missing a simple setting or something or has microsoft created something that isn't properly backward compatible? I know it's tighter on coding standards, but the errors it brings up seem irrelevant to these.