AlexInAustralia
asked on
'assert': identifier not found - in Release mode
I've got some cod which compiles fine in debug mode but gives the following error when compiling in release mode:
'assert': identifier not found
The simple fix is to put a #include <cassert> in the file where the problem occurs.
However, I thought assert statements are ignored in release mode, so technically I shouldn't be getting this problem.
I'm using Visual Studio 2005 Pro with SP1 running on WinXP with SP3. The application is a C++ solution and uses MFC.
'assert': identifier not found
The simple fix is to put a #include <cassert> in the file where the problem occurs.
However, I thought assert statements are ignored in release mode, so technically I shouldn't be getting this problem.
I'm using Visual Studio 2005 Pro with SP1 running on WinXP with SP3. The application is a C++ solution and uses MFC.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mayank13, you didn't tell anyting what wasn't already told.
Your first statement repeats what the asker has said in the initial question.
The second repeats the last sentence of my comment.
Your first statement repeats what the asker has said in the initial question.
The second repeats the last sentence of my comment.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
itsmeandnobodyelse: ... sorry for redundant answer, actually i didn't read comments i just read the problem and gave comments. I'll keep in mind for future.
>>>> However, "assert" is not a function, but a macro.
don't think that it is necessarily a macro.
And the error message is the same no matter whether it is a function or a macro.
don't think that it is necessarily a macro.
And the error message is the same no matter whether it is a function or a macro.
itsmeandnobodyelse,
from the C standard, which defines assert.h
7.2 Diagnostics
1 The header defines the assert macro and refers to another macro,
NDEBUG which is not defined by . If NDEBUG is defined as a macro name at the
point in the source file where is included, the assert macro is defined
simply as
#define assert(ignore) ((void)0)
The assert macro is redefined
norsemanna
norsethomas, thanks.
ASKER
Thank you guys for your help
At runtime, assert function not called but, at compile time compiler needs definition of assert() function.