C++ Program in Xcode not outputting simple text file using outFile

前端 未结 3 1597
感情败类
感情败类 2020-12-28 16:49

I am running a program using this simple example code to output a text file. I am using Xcode and simply started a new C++ project from command line tools. For some reason t

相关标签:
3条回答
  • 2020-12-28 17:25

    Dang I can't believe I figured it out, it was an option in Xcode. So I clicked on the bar at the top of xcode near the stop button with the text (Project Name > My Mac 64-bit)

    Then clicked edit scheme. The clicked on the options tab and clicked use custom working directory. Then selected a working directory. Now the text file appears!

    0 讨论(0)
  • 2020-12-28 17:29

    To find the current working directory, in the project navigator, under the "Products" folder, right-click the product and choose "Show in Finder". In this directory you will also find the compiled code.

    For example: ~/Library/Developer/Xcode/DerivedData/<project name>-gweghgfqkjkidjfhcgetdryechjz/Build/Products/Debug

    0 讨论(0)
  • 2020-12-28 17:37

    As mentioned above, editing the scheme worked for me but getting to the scheme was different.

    • Use the Product Menu
    • Select the Scheme option
    • Select the Edit Scheme option
    • Click the Options Tab
    • Tick the "Working Directory" item
    • Click the small icon at the right end of the text box.
    • Select the directory

    I also had the Run/Debug option selected in the left hand pane of the window.

    0 讨论(0)
提交回复
热议问题