Why the results of debug and release version is different.

B

bantamweight

Hi,
I create a project with vs2005 (both c++ and c# are used, sames the
problem is about c++) and it working well in Debug version but the
result is wrong in Release version. I checked again and again and no
difference of logic is found between two versions. I'm confused and
don't known how to correct it. Is there anyone encountered similar
deed? Any tips is wellcome.

Regards.

Bai Xiaoliang.
 
M

Michael Nemtsev

Hello (e-mail address removed),

It's due to optimization in the Release mode.
Could you clarify what is different?
Hi,
I create a project with vs2005 (both c++ and c# are used, sames the
problem is about c++) and it working well in Debug version but the
result is wrong in Release version. I checked again and again and no
difference of logic is found between two versions. I'm confused and
don't known how to correct it. Is there anyone encountered similar
deed? Any tips is wellcome.
Regards.

---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
J

Jon Skeet [C# MVP]

I create a project with vs2005 (both c++ and c# are used, sames the
problem is about c++) and it working well in Debug version but the
result is wrong in Release version. I checked again and again and no
difference of logic is found between two versions. I'm confused and
don't known how to correct it. Is there anyone encountered similar
deed? Any tips is wellcome.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
B

Bai Xiaoliang

Hi,
Thanks for all kindly answers.
The problem is caused by my negligence.
My solution including several projects, yesterday, I moved one header
file which including template classes from project A to B and corrected
implemention of the template classes. I only build the release verion
of the solution without clean solution first. Thus the wrong result is
gotten. And after clean the solution firstly before build the
solution(or rebuild), every thing is right.

Regard.

Bai Xiaoliang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top