简体   繁体   中英

XCode: File not found error

I'm using writing a program in XCode and I can't I can't seem to get XCode to find a txt file that I need to read from (in order to test my program). The program compiles and runs appropriately with g++.

Thanks, Jacob

我在回答自己的问题,找不到如何读取与.cpp文件位于同一目录中的文件,但是,我键入了cout << argv [0],这给了我可执行文件目录,我把文件放在那里,然后运行。

为了使Xcode在不使用代码路径的情况下查看文件,需要将文件放置在以下目录中:

/Users/Jacob/Library/Developer/Xcode/DerivedData/SomeProjectName/Build/Products/Deb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM