Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I have started to code my library called cfExstentions that requires the ConfigFile library. I included the ConfigFile.h file into my cfExtensions.cpp file. I tried to initialize the ConfigFile library by coding:
Code that does not work:
//OLD CODE //cfExtensions.cpp file cfExtensions::cfExtensions() { ConfigFile cfg; LocalFileSystem local("local"); } void cfExtensions::loadConfigFile() { /* * Read a configuration file from a mbed. */ if (!cfg.read("/local/settings.cfg")) { //line 45 printf("Failure to read a configuration file.\n"); } } // End of loadConfigFileLine 45 is throwing an error: identifier "cfg" is undefined. I'm assuming that I am not calling cfg correctly? What am I not doing?
EDIT: I fixed that issue by initializing the ConfigFile library outside of my constructor.