Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: zdai on November 28, 2007, 02:23:53 am

Title: thanks for reply
Post by: zdai on November 28, 2007, 02:23:53 am
Thank you guys. The program in VC++ works well in windows OS. Many people are using it for several years. I have changed anything related to MFC, then compiled and built it in C::B IDE, no warning and no error. When I clicked "RUN" botton on tool bar of C::B IDE, several seconds later the program terminated without error, but the output was not correct. I debugged it step by step, the output was correct. It is that I said "works in debug mode, does not in release". Thanks again.
Title: Re: thanks for reply
Post by: alchemist on November 28, 2007, 10:19:32 am
hello,

why don't you continue your first post (http://forums.codeblocks.org/index.php/topic,7360.msg55962.htm)?
Title: Re: thanks for reply
Post by: thomas on November 28, 2007, 01:39:23 pm
What you describe typically happens if you don't initialise a variable properly. Maybe in the "changed anything related to MFC" something like that happened.

The debugger initialises all variables to 0, so code like if(foo != 0) will work as expected in the debugger but will fail without it.

With some luck, the compiler will give you an appropriate warning if you compile with -Wall (although it does not detect it in every case). Otherwise, this can be a long, painful search.