Run C program in Xcode 4 using makefile

后端 未结 2 1158
野性不改
野性不改 2021-01-18 16:35

I have created an \'External Build Project\' in Xcode 4 using a makefile. The project builds perfectly, except the only way I know how to get it to run is in Terminal.

相关标签:
2条回答
  • 2021-01-18 16:49

    Yes, you can! Product -> Edit scheme Select "Run" from the left panel, select "Info" from top and specify "Executable" drop list Select next pane "Arguments" and add "Arguments Passed On Launch" (to "Executable" you select before)

    0 讨论(0)
  • 2021-01-18 16:59

    Yes, you need to create a Custom Executable, so that Xcode knows where your built executable resides and how to run it. In Xcode 3 it's Project -> New Custom Executable....

    This will allow you to to run your executable and even do source level debugging if you have added the source code to the project. The only minor hassle is that you have to manually select which custom executable is "active" when you switch between e.g. debug and release builds.


    Note re Xcode 4: I don't use Xcode 4 but looking at the online help the nearest equivalent to Xcode 3's "custom executable" seems to be:

    Customize Executables in the Scheme Editor
    To customize the environment in which a product is launched in Xcode 3, you click the executable in the Groups & Files list and then open the Info window. In Xcode 4, choose Edit Active Scheme from the Scheme pop-up and choose the product you want to run (Figure 3-10). Note that you can choose to display the running product at a higher UI resolution to simulate running at a different display resolution.

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