This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

identifier "ASSERT" is undefined

Other Parts Discussed in Thread: C2000WARE

调试280049的can,遇到一个非常奇怪的问题,工程里不管在Predefined symbols中定义DEBUG还是不定义,编译时都出错:

#20 identifier "ASSERT" is undefined

can.h和can.c(使用的是C2000Ware_1_00_06_00)中的ASSERT都会报错,can.h中已经显示的包含了“#include "debug.h"”

而debug.h中有以下定义:

#ifdef DEBUG
#define ASSERT(expr) do \
{ \
if(!(expr)) \
{ \
__error__(__FILE__, __LINE__); \
} \
} \
while(0)
#else
#define ASSERT(expr)
#endif

但是错误一直存在,用rebuild,clean以后build,删除debug文件夹都存在这个问题!