just in time debugging error

May 13, 2008 at 10:27am
Hello everybiody!
I am using visual c++.Net 2003 for the first time . My programm reads a file using a read parser. I compiled the programm in debug mode...everything is fine and the results are in the output file but when I change to release mode...no resuls are given...although the programm is error free.
A message is appeared when I run the programm in Dos saying that there is a just in time error and a hint is given to the (read)function.
where is the problem exactly and how could I solve it.
Thanks for any help.
May 13, 2008 at 3:59pm
Debug mode sometimes masks errors that cause failure in release mode (because the debugging code isn't there to catch and 'correct' the error).

Go to your project options and turn on every debug option you can find and compile again. Watch for things like uninitialized variables.

Hmm.. Here's a post I was able to find with some pretty comprehensive listings of things to do:
http://www.velocityreviews.com/forums/showpost.php?p=1496265&postcount=6

One final thing to check is which runtime libraries are being linked into your program. Release mode should not be linking with debug mode libraries. (And yes, there are zillions of different versions of runtime libraries... alas.)

Hope this helps.
May 14, 2008 at 7:02am
Thank you Duoas!
The link you provided is very useful and my problem is summarized in the first point:

1. ASSERT() statements containing necessary code
statements being optmized/preprocssed out of the
release code. Use VERIFY() instead.

I am using a simulator that has man assert statements....the error is messaged to e in that statements...I replaced Assert with verify and I got the following error:

cpetrinet.cpp(709) : error C3861: 'VERIFY': identifier not found, even with argument-dependent lookup

How could I solve it?
May 14, 2008 at 5:02pm
I don't know. You'll have to read the simulator's documentation.

The best bet would be not to place anything that you want to keep in RELEASE mode inside an ASSERT macro. Use temporary variables (which the compiler will eliminate in RELEASE mode):
1
2
  int f = fooey( 24, x );
  ASSERT( f >= 0 );


Keep in mind that assertions are for validating your program, not for handling run-time errors that you can expect to occur in production operation.

Hope this helps.
Topic archived. No new replies allowed.