Board index » cppbuilder » CPPSAVEX_MAGIC assertion
Shawn Butler
![]() CBuilder Developer |
CPPSAVEX_MAGIC assertion2004-09-10 04:08:36 AM cppbuilder102 So, I'm faced with a quandry to the point where I don't know where to proceed to debug from here. Using BCB6 sp4 (5.6.4), the code sketched out below compiles, links, executes normally when compiled using the BCB6 IDE. However, after using the supplied bpr2mak.exe and compiling from the commandline I receive: derived.cpp Assertion failed .\base.h(xx) : sym->symTempCheck.tempCheck == CPPSAVEX_MAGIC at d:\helena\bcc\indep\cppsavex.c(124) where xx is the line number of next_time() function declaration in base.h. TDateTime::CurrentDateTime() is a static method so I see no problem with this syntactically. This code compiles normally under BCB5 IDE and command line. I have no idea why it compiles and executes using the BCB6 IDE and not the command line and am stymied on how to proceed. Removing the default argument to the next_time() method removes the compile time assertion. The command line options being generated by the bpr2mak.exe are -Od -H=myheader.csm -Hc -Vx -Ve -X -r -a8 -b -k -y -v -vi -c -tW -tWM -w-par -I<include paths here>-D_DEBUG;_RTLDLL;NOSTRICT;USEPACAKAGES -nobj\ <.cpp files here> // token.h class Token { }; // base.h #include "token.h" #include <systdate> class Base { public: virtual TDateTime next_time(const Token &token, const TDateTime &after = TDateTime::CurrentDateTime()) = 0; }; //derived.h #include "base.h" class Derived : public Base { public: virtual TDateTime next_time(const HelperClass &helper, const TDateTime &after = TDateTime::CurrentDateTime()); }; // derived.cpp #include "derived.h" TDateTime Derived::next_time(const HelperClass &helper, const TDateTime &after) { return(TDateTime(0)); } |