can run C++ code from command line but not from debug mode in visual studio -


i compiled program below in debug mode without error. run .exe file command line when try debug code inside visual studio exception gets thrown line

detectioninternalsettings* internal_settings =            detectioninternalsettingsfactory::createfromfilesystem(                   "c:/data/card_detection_engine.yaml"); 

anyone faced situation before behavior different running command line , in debug mode.

int main(int argc, char **argv)  {     detectionsettings settings;     try     {         detectioninternalsettings* internal_settings =         detectioninternalsettingsfactory::createfromfilesystem("../data/card_detection_engine.yaml");     }     catch (const myexception &e)     {         fprintf(stderr, "exception raised: %s\n", e.what().c_str());         return 1;     }      return 0; } 

i went exception details , here first-chance exception @ 0x76e1c41f in ocrcarddetectionengine_sample.exe: microsoft c++ exception: yaml::typedbadconversion @ memory location 0x003ff0d0.

more code related createfromfilesystem

detectioninternalsettingsfactory::createfromfilesystem(const std::string &configpath)  throw (myexception) {   return new detectioninternalsettingsimpl(configpath); }  struct detectioninternalsettingsimpl : public detectioninternalsettings {     detectioninternalsettingsimpl(const std::string &config_path) {         if (config.readfromfilesystem(config_path)) {             throw myexception("bad configuration path.");         }     }      ~detectioninternalsettingsimpl() { }      core::detector::configuration config; }; 

trust debug mode exception. testing more thoroughly code doing while command line waiting problems happen.

in case, don't seem happen, because you're not doing pointer variable.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -