my program has specific error took me while track down - don't know how fix it. code long , in many files , don't see point in posting here.
in ide, runs fine, in both debug , release (with runtime library set either /mtd or /mt, respectively, i'm assuming dependencies included).
however, when run standalone, crash. @ first thought dependency problem doesn't seem so.
at point in code, accessing vector via method call: t->getlist()
, getlist defined std::vector<t*> & getlist()
, method returns member variable (simply defined std::vector<t*> field
in class).
it turns out, if print out size of list while running ide, 0 (which correct answer in case).
however, when doing same thing running standalone, size 467467353.
i tried changing method declaration std::vector<t*> * getlist()
, doing return &field;
, updating rest of code didn't fix anything.
i tried replacing member variable field
pointer, , in constructor instantiating new vector , deleting in destructor. still no luck.
so made simple test case program made class vector field, , method return reference it. in main
create instance variable , getting vector , printing size. worked both in vc++ , standalone - both returned zero.
this driving me nuts , can't figure out why i'm getting different behaviour. why standalone running differently, , should looking @ fix this?
thanks
okay literally bug in code hidden. dynamically casting wrong type.
somehow slipped past when running on windows , osx in both debug , release, , standalone on osx. thing found it.
Comments
Post a Comment