472,958 Members | 2,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 6176

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Wallukat | last post by:
Hi NG, I have a problem with a component written in VC6.0 SP5. The componnet shares Data over pointer: (PVOID)pData = (PVOID)some data... The debug version works fine... But I have...
2
by: | last post by:
Hi, I'm experiencing a bizar problem with MS VC++, and just can't figure out what's going on. I Build a solution that compiles pretty well, it works good when I launch it in the Visual C++ Editor...
1
by: spiff | last post by:
We are migrating from VC++ 6 to VC++ 2003. It is a plain, unmanaged application with both C and C++ source. When running the debug build, even outside the debugger, the memory allocation/deallocation...
4
by: andy6 via DotNetMonster.com | last post by:
I am in VS2005 Configuration Manager and have selected from the Active Solution Configuration "release". The deployment project and a supporting c# dll project both switch to release, however the...
5
by: B. | last post by:
We just recently move to code from VC++6 to VC++.NET 2005 and upgrade the warning level from 3 to 4. In debug mode, we compile the application with no warning no error, but when I build it in...
6
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi there We are trying to build a C sharp solution in Visual Studio 2005 Professional. We have a number of other assemblies, that do not form part of the solution. Assemblies that do form...
5
by: Andy B | last post by:
How do you tell vs2005 to keep debug info out of your release builds? When I build a release and a debug version, there seems to be no difference in them at all...The release builds still have the...
1
by: MaheBytes | last post by:
I have been facing a problem with UDP socket programming. I have to reuse port number for two different IP address. I am actually using SO_REUSEADD. I have no problem with debug version but with...
3
by: Bev in TX | last post by:
I am a complete newbie at building Python. I am trying to build it under MS Windows Vista (64-bit AMD) with MS VS2005. I'm doing that because I need debug libraries, which I did not see in the...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.