I'm new to Xcode. How can I add a file to the build output directory? I have a file.txt which I want to open in C++.
The following code...
string line;
ifstream file ("file.txt");
if (file.is_open())
{
while (file.good())
{
getline (file,line);
cout << line << endl;
}
file.close();
}
... results in Unable to open file.
I found out that the executable is deployed to /Users/myusername/Library/Developer/Xcode/DerivedData/IAIK_CMS_Test-dfmszjneldfwjffsmjpmtiepyzej/Build/Products/Debug/
I've tried to add the files in the project settings to the "Copy Files" in the "Build Phases". For details see this screenshot: https://i.sstatic.net/QhkIT.png
Edit: I'm looking for something like Eclipse's "add to Build Path" for Java.
Does anyone have a suggestion?

/usr/share/man/man1, which is probably not what you want..../Debug/in release mode to.../Release/and so on.../file.txt(the common parent ofDebugandreleaseor read from/home/you/file.txt(ie explicit/absolute path to your home directory).