Hello everybody!
I'm goind through the "SFML Game Development by Example" book and I stuck in chapter 4. The problem is, I can't open 'keys.cfg' file. When I try to do this, I'm getting this message: ! Failed loading keys.cfg.. In fact, the file is called 'keys.cfg.txt', but when I put this name into code, I got an error which says: "Segmentation fault (core dumped)".
I also tried to remove the .txt extension from the file name, but it doesn't work neither. What am I doing wrong? I event copied all files from the resource folder attached to the book, compiled it and the result is the same. I'm working on Ubuntu 16.04, CodeLite, g++.
I'm sure that 'keys.cfg.txt' file is in the right place, because loading of a mushroom texture works perfectly fine, and both files are in the same location.
Opening file:
#include <fstream>
...
std::ifstream bindings;
bindings.open("keys.cfg");
if (!bindings.is_open()){ std::cout << "! Failed loading keys.cfg." << std::endl; return; }
File I'm trying to open is attached.