I have created a text file with content. It is located in the same folder as the cpp files. And I have confirmed several times that the file exists. When I run g++, compile
Try to add files to the project in XCode or use the absolute path instead.
Your file fails to open because XCode launches from the IDE in the default build location, which is actually a temporary directory off somewhere on your disk. If you want change the working directory at launch-time to something else (like the location where your files can be found):
And in case you didn't see it, this is also the place where you can configure command-line arguments (on another tab) of the same dialog.