Code::Blocks Forums
User forums => Help => Topic started by: mIRChele on May 30, 2013, 10:15:29 pm
-
Hi, I began to start programming in C++ (using Code::Blocks) since 5 months. I use it both with Windows and Linux (mostly this one).
Today I encountered a problem: when I compile a program which uses other files from the directory using fstream (for example, it takes a text file from the program folder and then prints it on the screen) and I use the run option embedded in Code::Blocks, it doesn't work properly: if I choose to import a file from there, nothing happens (but the program acts as a file is in there, even if I delete this file, because I've put an error message if no files are found). Otherwise, if I choose to start the program from the terminal, it works perfectly.
Now, I'm pretty sure this didn't happened in the previous days (I'm not drunk, I assure you!), but the most strange thing is that I'm having this issue both on Windows and Linux! ???
What's happening there? Is my PC possessed? Or I'm just becoming mad?
-
Code?
have you checked Project->Properties->Build Targets->Execution Working dir (there should be the files, so your files shouldn't be in the bin folder, but in the project folder)
-
yeah i discovered that since yesterday it started to read files from the project folder, and not in bin/debug (or bin/release)... very strange it started now to work like this, but what's important is that now i can test it! thank you