Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string username;
- static string password;
- static string db;
- string Exchange::username = "user";
- string Exchange::password = "pass";
- string Exchange::db = "db";
- int main()
- {
- Config cfg;
- try {
- cfg.readFile("/misc/config.json");
- }
- catch(const FileIOException &fioex) {
- std::cerr << "I/O error while reading file." << std::endl;
- return(EXIT_FAILURE);
- }
- catch(const ParseException &pex) {
- std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine()
- << " - " << pex.getError() << std::endl;
- return(EXIT_FAILURE);
- }
- Exchange::username = cfg.lookup("username");
- Exchange::password = cfg.lookup("password");
- Exchange::db = cfg.lookup("db");
- ...
- error: 'std::string Exchange::username' is private
- string Exchange::username = "user";
- ^
- error: within this context
- Exchange::username = cfg.lookup("username");
- ^
- error: ambiguous overload for 'operator=' (operand types are 'std::string {aka std::basic_string<char>}' and 'libconfig::Setting')
- Exchange::username = cfg.lookup("username");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement