Error Compiling VC 6.0 program in VS.net B2 
Author Message
 Error Compiling VC 6.0 program in VS.net B2

I had a program written using Visual Studio 6 (VC++).  It compiled fine
there, with the exception of some warnings about conversions from
double->int (which was my intent).

I installed VS.NET B2 and tried compiling the same program.  I get the usual
warnings, except I am also getting several linking errors:

StarKingdoms ForceCalc fatal error LNK1169: one or more multiply defined
symbols found
StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

nafxcwd.lib(afxmem.obj)
StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

nafxcwd.lib(afxmem.obj)

Anyone have any idea where these might have come from and what I can do to
fix them?

Also, everytime I open the project, it asks me if I want to convert it... I
always say 'yes' but it doesn't seem to save the conversion, it just asks me
again next time.

Thanks for your help

--
Adam Clauss



Fri, 30 Apr 2004 03:18:11 GMT  
 Error Compiling VC 6.0 program in VS.net B2
Hi Adam we're looking into the problem for you, would it be possible to get
a repro case from you?

Thanks
Pranish Kumar


Quote:
> I had a program written using Visual Studio 6 (VC++).  It compiled fine
> there, with the exception of some warnings about conversions from
> double->int (which was my intent).

> I installed VS.NET B2 and tried compiling the same program.  I get the
usual
> warnings, except I am also getting several linking errors:

> StarKingdoms ForceCalc fatal error LNK1169: one or more multiply defined
> symbols found
> StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

> nafxcwd.lib(afxmem.obj)
> StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

> nafxcwd.lib(afxmem.obj)

> Anyone have any idea where these might have come from and what I can do to
> fix them?

> Also, everytime I open the project, it asks me if I want to convert it...
I
> always say 'yes' but it doesn't seem to save the conversion, it just asks
me
> again next time.

> Thanks for your help

> --
> Adam Clauss




Sat, 01 May 2004 08:04:54 GMT  
 Error Compiling VC 6.0 program in VS.net B2
It keeps asking you to do the conversions because you keep opening the .dsw
file. The .dsw file is used to create the new project files but it isn't
modified in any way. What you will end up with is a solution file (extension
of .sln) and a project file (extension of .vcproj). A solution is a
container of projects. So, you'll want to open up the .sln file after the
conversion is complete.

As far as the linker problem. I'd turn on Verbose linking (/VERBOSE linker
switch) and look at where the problem symbol is being pulled in from. It's
coming from more than one place and it shouldn't be. Let me know what the
result of that search is.

Thanks,
Mike

Quote:
> I had a program written using Visual Studio 6 (VC++).  It compiled fine
> there, with the exception of some warnings about conversions from
> double->int (which was my intent).

> I installed VS.NET B2 and tried compiling the same program.  I get the
usual
> warnings, except I am also getting several linking errors:

> StarKingdoms ForceCalc fatal error LNK1169: one or more multiply defined
> symbols found
> StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

> nafxcwd.lib(afxmem.obj)
> StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

> nafxcwd.lib(afxmem.obj)

> Anyone have any idea where these might have come from and what I can do to
> fix them?

> Also, everytime I open the project, it asks me if I want to convert it...
I
> always say 'yes' but it doesn't seem to save the conversion, it just asks
me
> again next time.

> Thanks for your help

> --
> Adam Clauss




Sat, 01 May 2004 23:23:57 GMT  
 Error Compiling VC 6.0 program in VS.net B2
Ok, did that and found the two error lines:
libcimtd.lib(ifstream.obj) : error LNK2005: "void __cdecl operator

nafxcwd.lib(afxmem.obj)

libcimtd.lib(ofstream.obj) : error LNK2005: "void __cdecl operator

nafxcwd.lib(afxmem.obj)

I AM using streams in a portion of my program, but why would it cause an
error here and not in VC6?

--
Adam Clauss


Quote:
> It keeps asking you to do the conversions because you keep opening the
.dsw
> file. The .dsw file is used to create the new project files but it isn't
> modified in any way. What you will end up with is a solution file
(extension
> of .sln) and a project file (extension of .vcproj). A solution is a
> container of projects. So, you'll want to open up the .sln file after the
> conversion is complete.

> As far as the linker problem. I'd turn on Verbose linking (/VERBOSE linker
> switch) and look at where the problem symbol is being pulled in from. It's
> coming from more than one place and it shouldn't be. Let me know what the
> result of that search is.

> Thanks,
> Mike


> > I had a program written using Visual Studio 6 (VC++).  It compiled fine
> > there, with the exception of some warnings about conversions from
> > double->int (which was my intent).

> > I installed VS.NET B2 and tried compiling the same program.  I get the
> usual
> > warnings, except I am also getting several linking errors:

> > StarKingdoms ForceCalc fatal error LNK1169: one or more multiply defined
> > symbols found
> > StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

> > nafxcwd.lib(afxmem.obj)
> > StarKingdoms ForceCalc error LNK2005: "void __cdecl operator delete(void

> > nafxcwd.lib(afxmem.obj)

> > Anyone have any idea where these might have come from and what I can do
to
> > fix them?

> > Also, everytime I open the project, it asks me if I want to convert
it...
> I
> > always say 'yes' but it doesn't seem to save the conversion, it just
asks
> me
> > again next time.

> > Thanks for your help

> > --
> > Adam Clauss




Tue, 04 May 2004 03:10:23 GMT  
 Error Compiling VC 6.0 program in VS.net B2


Quote:
>Ok, did that and found the two error lines:
>libcimtd.lib(ifstream.obj) : error LNK2005: "void __cdecl operator

>nafxcwd.lib(afxmem.obj)

>libcimtd.lib(ofstream.obj) : error LNK2005: "void __cdecl operator

>nafxcwd.lib(afxmem.obj)

>I AM using streams in a portion of my program, but why would it cause an
>error here and not in VC6?

You're linking to the MFC debug library "nafxcwd.lib".  If you're not
using MFC you need to look at the libraries you use to see if they're
including any MFC.

As the linker think you need MFC, it also thinks you need
"libcimtd.lib" which is the old C++ standard library.  You know things
like

#include <string.h>

was chaged to:

#include <string>

With the way Win32 works with it's combinations of static/dynamic
linked libraries, the library you use for the above includes is
different.

The C++ libraries with the .h dynamicly link (if needed) to the old
C++ runtime library "msvcirt(d)(u)".  The new ones without the .h link
to the library "msvcprt(d)(u)".

This wouldn't be so bad but both libraries provide their own version
of new() and the linker sees those two exactly-defined global
functions.

Somewhere, you've got some code that uses the .h version of ofstream,
which needs the old library.  Lines like:

using namespace std;

or

#pragma linker(lib, "msvcirtd.lib)

Will only make it harder to find where you use the old version of the
stream class.

If you find the prgma directive, you may not be allowed to comment it
out (but you could do  #ifdef MSVC < 13 or something similar that
works to denote the new compiler).  You can tell the linker to throw
all included libraries but you have to add the yourself which gives
you some control and order to how the libraries get linked.

Anyway, happy hunting, hope you sort it.  Good luck,

Jim M



Tue, 04 May 2004 06:04:15 GMT  
 Error Compiling VC 6.0 program in VS.net B2
Yes, I am using MFC, and I have the include:
#include <iostream.h>

So I should change that to:

#include <iostream>

Correct?
I'll give it a try
--
Adam Clauss


Quote:


> >Ok, did that and found the two error lines:
> >libcimtd.lib(ifstream.obj) : error LNK2005: "void __cdecl operator

in
> >nafxcwd.lib(afxmem.obj)

> >libcimtd.lib(ofstream.obj) : error LNK2005: "void __cdecl operator

in
> >nafxcwd.lib(afxmem.obj)

> >I AM using streams in a portion of my program, but why would it cause an
> >error here and not in VC6?

> You're linking to the MFC debug library "nafxcwd.lib".  If you're not
> using MFC you need to look at the libraries you use to see if they're
> including any MFC.

> As the linker think you need MFC, it also thinks you need
> "libcimtd.lib" which is the old C++ standard library.  You know things
> like

> #include <string.h>

> was chaged to:

> #include <string>

> With the way Win32 works with it's combinations of static/dynamic
> linked libraries, the library you use for the above includes is
> different.

> The C++ libraries with the .h dynamicly link (if needed) to the old
> C++ runtime library "msvcirt(d)(u)".  The new ones without the .h link
> to the library "msvcprt(d)(u)".

> This wouldn't be so bad but both libraries provide their own version
> of new() and the linker sees those two exactly-defined global
> functions.

> Somewhere, you've got some code that uses the .h version of ofstream,
> which needs the old library.  Lines like:

> using namespace std;

> or

> #pragma linker(lib, "msvcirtd.lib)

> Will only make it harder to find where you use the old version of the
> stream class.

> If you find the prgma directive, you may not be allowed to comment it
> out (but you could do  #ifdef MSVC < 13 or something similar that
> works to denote the new compiler).  You can tell the linker to throw
> all included libraries but you have to add the yourself which gives
> you some control and order to how the libraries get linked.

> Anyway, happy hunting, hope you sort it.  Good luck,

> Jim M
> --




Tue, 04 May 2004 06:44:28 GMT  
 Error Compiling VC 6.0 program in VS.net B2


Quote:
>Yes, I am using MFC, and I have the include:
>#include <iostream.h>

>So I should change that to:

>#include <iostream>

>Correct?
>I'll give it a try

Are you mixing non-.h with .h includes ?

It may not be as simple as {*filter*} off the .h as the old io streams
were a bit different in some areas.  It all depends on how much code
you need to change.

Something else I've thought of when I got this sort of error last.

Static library that uses MFC.  Compiled to use MFC staticly.  MFC in
static mode needs run-time library linked staticly also.  Tried to get
the static lib built with dynamic C and C++ run-time library (as well
as the dll that uses it) but couldn't.  It was a restriction for the
exe that uses the dll to have dynamic c-run-time library linkage.
Couldn't do it last-time I tried, don't think it's possible.

Jim M



Tue, 04 May 2004 09:13:36 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Compile error on generated ActiveX MFC wrapper class ( VC++7, VS.NET 2002 )

2. Link Errors in VC.net that don't appear in VC 6.0

3. xlocale problem in vs.net b2

4. Whistler Refresh /VS.net B2

5. Save a project in VS.net B2

6. i needs the vs.net b2

7. Framework b2 && VS.Net b1

8. VC++ 6.0 vs VC++.NET and IBM UDB Stored Procedures

9. Streams: VC++ 6.0 vs VC.NET 2003

10. VC++ 6.0 vs VC++.Net

11. Code which used to compile in VC++ 6.0 gives C2593 error in VC++ .Net

12. Updating VC 6 program to VC .NET produces assertion error

 

 
Powered by phpBB® Forum Software