473,756 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.l ib" 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*****@discus sions.microsoft .comwrote in message
news:8E******** *************** ***********@mic rosoft.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.hwhi ch 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\xd ebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cas t, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(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.

"Christophe r 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.l ib" 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*****@discus sions.microsoft .comwrote in message
news:8E******** *************** ***********@mic rosoft.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.hwhi ch 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\xd ebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cas t, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(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.

"Christophe r 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.l ib" 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*****@discus sions.microsoft .comwrote in message
news:8E******** *************** ***********@mic rosoft.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.hwhi ch 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\xd ebug(32) : warning
C4229: anachronism used : modifiers on data are ignored
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2365: 'operator new' : redefinition; previous definition was 'function'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2491: 'new' : definition of dllimport data not allowed
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2078: too many initializers
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires
reinterpret_cas t, C-style cast or function-style cast
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2143: syntax error : missing ';' before '('
d:\program files\microsoft visual studio 8\vc\include\xd ebug(32) : error
C2226: syntax error : unexpected type 'size_t'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(33) : error
C2059: syntax error : ')'
d:\program files\microsoft visual studio 8\vc\include\xd ebug(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
1499
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 compiled the release version, and now it does not work ...
2
3987
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 (F5 or shift+ F5) but the .exe file generated in a release mode doesn't work properly ! Anye clue ??
1
2079
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 performance appears to be orders of magnitude slower than in VC++ 6. The release build runs fine - no performance problems. We've rewritten some of the code to do fewer memory allocations/deallocations and that has helped those pieces. However,...
4
2096
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 website remains at debug. When I attempt to change the dropdown for the website debug is the only option. How can I ensure that when I build that the entire solution including the website is in release mode? -- Message posted via...
5
3220
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 release mode, there are quite few C4701 warnings and some C2679 errors. Note that some of warning and error happens in debug mode as well and was fixed. Anyone know why some of warning and error happens only in release mode?
6
2388
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 part of the solution have been referenced using the Projects tab in the Add Reference dialog. Assemblies that do not form part of the solution have been added usingthe
5
1801
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 debug databases with them...
1
2486
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 release version the bind is failing for 2nd IP address with the error code 10048. It's the error code for WSAEADDRINUSE. I am trying to with WinXP machine using Visual C++ 6.0. The application which we are using needs to connect to Primary and Backup...
3
6799
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 standard distribution. I downloaded the source and found the MSVS8 solution/project files. However, when I tried to build it I got the following error: ....\python-2.5.2\modules\_sqlite\connection.h(33) : fatal error C1083: Cannot open include...
0
9456
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...
1
9846
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
9713
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...
1
7248
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
6534
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();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
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
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.