469,903 Members | 1,430 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Debug Build fails, Release Build OK - VC++ 6.0 to VS2005 port

I'm trying to upgrade a large project from VS 6.0 to VS 2005.
After fixing a lot of things that changed (mostly sloppy coding in the
original project that VS2005 didn't allow), I got the release version to
build successfully. Unfortunately, it crashes right away when I start it.
So now I need to build the debug version. Unfortunately, the compiler gives
innumerable error messages of the sort shown below.

The #include file referenced here is included by way of <fstreamand its
subsidiary files. The original project used <fstream.hwhich no longer
exists. Apparently the code syntax of my fixes satisfies the compiler, since
the release version builds successfully. So maybe there is a switch I need
to throw? But I can't find it. Searching MSDN, these newsgroups, etc.,
didn't turn up anything, but I'll be this is something that has been
discussed in the past.

Thanks in advance.

--
C Gregory
Tecmag, Inc.

Compiling...
AcqPropsDialog.cpp
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xdebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xdebug(36) : warning
C4229: anachronism used : modifiers on data are ignored
.....etc.....
Oct 20 '06 #1
4 5987

You need to get rid of every single deprecated header that has been replaced
by the new (not so new) std library.
There is a list on MSDN if you search for iostream libraries or
"msvcirtd.lib" I think... I can check on monday at work.

Things like
fstream.h
iostream.h
ios.h
string.h

etc. all need to be the on .h includes
such as
fstream
iostream
etc..

Then of course you must specify std:: or make use of using statements

As such, you must also check that every include that is included by and
included file also does not contain those.. fun!
Also, every lib and .dll linked with must also use the new includes and have
the flag below the same.

And of course the implementation may need to be changed to reflect the c++
standard

Also make sure you do not have /MDd set but instead of /MTd set in the
project settings. I think it is one of the linker settings.
It controls which iostream library you link with for debug
the old one was msvcirtd.lib, I believe, which no longer exists in at least
my vc8 install.

It's a place to start anyway.

It appears to me that something is causing the older library and the new
library to both be linked and it is not liking that. That's my theory.

"nmrcarl" <nm*****@discussions.microsoft.comwrote in message
news:8E**********************************@microsof t.com...
I'm trying to upgrade a large project from VS 6.0 to VS 2005.
After fixing a lot of things that changed (mostly sloppy coding in the
original project that VS2005 didn't allow), I got the release version to
build successfully. Unfortunately, it crashes right away when I start it.
So now I need to build the debug version. Unfortunately, the compiler
gives
innumerable error messages of the sort shown below.

The #include file referenced here is included by way of <fstreamand its
subsidiary files. The original project used <fstream.hwhich no longer
exists. Apparently the code syntax of my fixes satisfies the compiler,
since
the release version builds successfully. So maybe there is a switch I
need
to throw? But I can't find it. Searching MSDN, these newsgroups, etc.,
didn't turn up anything, but I'll be this is something that has been
discussed in the past.

Thanks in advance.

--
C Gregory
Tecmag, Inc.

Compiling...
AcqPropsDialog.cpp
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xdebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xdebug(36) : warning
C4229: anachronism used : modifiers on data are ignored
....etc.....

Oct 21 '06 #2
Christopher
Thanks for the suggestions. I thought I had fixed the deprecated calls,
etc.-- but i'll check again.

The thing that troubles me is that it doesn't seem to be a linker problem -
the error is during compilation - some flag is being set by the fstream
header that is resented by subsequent headers....and only if it is a debug
build!
C Gregory
Tecmag, Inc.

"Christopher Pisz" wrote:
>
You need to get rid of every single deprecated header that has been replaced
by the new (not so new) std library.
There is a list on MSDN if you search for iostream libraries or
"msvcirtd.lib" I think... I can check on monday at work.

Things like
fstream.h
iostream.h
ios.h
string.h

etc. all need to be the on .h includes
such as
fstream
iostream
etc..

Then of course you must specify std:: or make use of using statements

As such, you must also check that every include that is included by and
included file also does not contain those.. fun!
Also, every lib and .dll linked with must also use the new includes and have
the flag below the same.

And of course the implementation may need to be changed to reflect the c++
standard

Also make sure you do not have /MDd set but instead of /MTd set in the
project settings. I think it is one of the linker settings.
It controls which iostream library you link with for debug
the old one was msvcirtd.lib, I believe, which no longer exists in at least
my vc8 install.

It's a place to start anyway.

It appears to me that something is causing the older library and the new
library to both be linked and it is not liking that. That's my theory.

"nmrcarl" <nm*****@discussions.microsoft.comwrote in message
news:8E**********************************@microsof t.com...
I'm trying to upgrade a large project from VS 6.0 to VS 2005.
After fixing a lot of things that changed (mostly sloppy coding in the
original project that VS2005 didn't allow), I got the release version to
build successfully. Unfortunately, it crashes right away when I start it.
So now I need to build the debug version. Unfortunately, the compiler
gives
innumerable error messages of the sort shown below.

The #include file referenced here is included by way of <fstreamand its
subsidiary files. The original project used <fstream.hwhich no longer
exists. Apparently the code syntax of my fixes satisfies the compiler,
since
the release version builds successfully. So maybe there is a switch I
need
to throw? But I can't find it. Searching MSDN, these newsgroups, etc.,
didn't turn up anything, but I'll be this is something that has been
discussed in the past.

Thanks in advance.

--
C Gregory
Tecmag, Inc.

Compiling...
AcqPropsDialog.cpp
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xdebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xdebug(36) : warning
C4229: anachronism used : modifiers on data are ignored
....etc.....


Oct 23 '06 #3
Can you also check what is the Warning Level set for the debug mode.
Typically any new project will have /W4

And Also move fstream on top of the include sequence

"nmrcarl" wrote:
Christopher
Thanks for the suggestions. I thought I had fixed the deprecated calls,
etc.-- but i'll check again.

The thing that troubles me is that it doesn't seem to be a linker problem -
the error is during compilation - some flag is being set by the fstream
header that is resented by subsequent headers....and only if it is a debug
build!
C Gregory
Tecmag, Inc.

"Christopher Pisz" wrote:

You need to get rid of every single deprecated header that has been replaced
by the new (not so new) std library.
There is a list on MSDN if you search for iostream libraries or
"msvcirtd.lib" I think... I can check on monday at work.

Things like
fstream.h
iostream.h
ios.h
string.h

etc. all need to be the on .h includes
such as
fstream
iostream
etc..

Then of course you must specify std:: or make use of using statements

As such, you must also check that every include that is included by and
included file also does not contain those.. fun!
Also, every lib and .dll linked with must also use the new includes and have
the flag below the same.

And of course the implementation may need to be changed to reflect the c++
standard

Also make sure you do not have /MDd set but instead of /MTd set in the
project settings. I think it is one of the linker settings.
It controls which iostream library you link with for debug
the old one was msvcirtd.lib, I believe, which no longer exists in at least
my vc8 install.

It's a place to start anyway.

It appears to me that something is causing the older library and the new
library to both be linked and it is not liking that. That's my theory.

"nmrcarl" <nm*****@discussions.microsoft.comwrote in message
news:8E**********************************@microsof t.com...
I'm trying to upgrade a large project from VS 6.0 to VS 2005.
After fixing a lot of things that changed (mostly sloppy coding in the
original project that VS2005 didn't allow), I got the release version to
build successfully. Unfortunately, it crashes right away when I start it.
So now I need to build the debug version. Unfortunately, the compiler
gives
innumerable error messages of the sort shown below.
>
The #include file referenced here is included by way of <fstreamand its
subsidiary files. The original project used <fstream.hwhich no longer
exists. Apparently the code syntax of my fixes satisfies the compiler,
since
the release version builds successfully. So maybe there is a switch I
need
to throw? But I can't find it. Searching MSDN, these newsgroups, etc.,
didn't turn up anything, but I'll be this is something that has been
discussed in the past.
>
Thanks in advance.
>
--
C Gregory
Tecmag, Inc.
>
Compiling...
AcqPropsDialog.cpp
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xdebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xdebug(36) : warning
C4229: anachronism used : modifiers on data are ignored
....etc.....
Oct 23 '06 #4
Vikas

Thanks! I moved <fstreamup just after "stdafx.h", and now it works. The
warning level was /W3, but /W4 did not provide any (helpful) extra info.

Carl
--
C Gregory
Tecmag, Inc.

"Vikas Kumar" wrote:
Can you also check what is the Warning Level set for the debug mode.
Typically any new project will have /W4

And Also move fstream on top of the include sequence

"nmrcarl" wrote:
Oct 23 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Christian Wallukat | last post: by
2 posts views Thread by | last post: by
4 posts views Thread by andy6 via DotNetMonster.com | last post: by
6 posts views Thread by =?Utf-8?B?SHVnaA==?= | last post: by
5 posts views Thread by Andy B | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.