Solved

program works in debug but not in release mode

Posted on 2004-04-13
10
232 Views
Last Modified: 2010-04-01
hi

i'm writing a program to read cpu details etc.
but the program will cause 100% cpu usage and not respond under release mode but in debug it works fine
you can find both version at
http://members.optusnet.com.au/madonion87/Debug.zip
http://members.optusnet.com.au/madonion87/Release.zip

someone already suggested that it might be the compiler optimization problem, i tried turning off optimization in MS VS.net 2003 but it doesnt help

any ideas would be very appreciated
0
Comment
Question by:madonion87
  • 4
  • 3
  • 2
  • +1
10 Comments
 

Author Comment

by:madonion87
ID: 10811156
this might help

"in the release build, after GetMessage is called, it goes on comparing whether the call has failed, and if not calls TranslateMessage and so on but the loop is very tight. whats more odd is the program never seems to pass control to windows, and forever looping and handling messages.

whereas in the debug build, after all messages are handled, program passes control to windows after a GetMessage call."

another guy i know in ocau forum said it, i'm not very sure what he means though
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 100 total points
ID: 10811261
You need to post source code (some code fragments may be posted here, or make the whole project available for download). exe file doesn't help us to solve your problem.
Except of this, I don't beleive there is an expert who downloads unknown exe file from WEB and runs it on his own computer :-)
0
 

Author Comment

by:madonion87
ID: 10811425
lol sorry

you can find the source code at http://members.optusnet.com.au/madonion87/muon.cpp

tell me if you need the header files
0
 
LVL 86

Expert Comment

by:jkr
ID: 10812896
>>you can find the source code at ...
>>tell me if you need the header files

Everything that you do not post here is pointless, as it renders the Q worthless for others. Sorry.
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 200 total points
ID: 10812920
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 14

Accepted Solution

by:
wayside earned 200 total points
ID: 10813652
Check out http://www.codeguru.com/forum/showthread.php?s=&threadid=269905

or

http://www.codeproject.com/debug/survivereleasever.asp

for some good discussion on why things work in debug and not in release, and what to do to fix it.
0
 

Author Comment

by:madonion87
ID: 10821959
i've already looked at that site, tried turning off optimization as well, didnt help
thats why i want to see if anyone have also experienced the same problem, or know what might have caused it
0
 
LVL 86

Expert Comment

by:jkr
ID: 10825044
So, have you also tried to _DEBUG_ your release build then?
0
 
LVL 14

Expert Comment

by:wayside
ID: 10828224
When all else fails...

add print statements.
0
 

Author Comment

by:madonion87
ID: 10832610
turning off aliasing fixed the problem
i think i will split the points into those who contributed, thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now