Reputation: 137
I am using Xcode to do C++ programming but the problem is when i build the program it doesnot creat a executable file like Turbo C++ creates a .exe file. What can i do to create such executable file on OS X environment using xcode.?
Upvotes: 6
Views: 28449
Reputation: 71
you need to find the working directory of Xcode.
If you are working with C/C++, type system("pwd"); in your main function. This will print your working directory. In which you shall find the executable.
(I am not sure about other languages but there must be a substitute for system()).
your output should look something like this: /Users/your_username/Library/Developer/Xcode/DerivedData/Build/Products/Debug
Upvotes: 0
Reputation: 11
I got a simple solution for you got Product > archive and select distribute content and use the build option. Dig deep into the folder created and you can find the Mac executable file that'll run almost on any Mac.
Upvotes: 1
Reputation: 131
Follows this: File->Project Settings->under Derived Data, Click the Advanced->Click Custom, then choose the option Relative to Workspace->Done. Then build your code and you will see Product file package in your project path. I am using Xcode 8.2.1, hope it may help.
Upvotes: 11
Reputation: 4497
I'll try to summarise the following article and hope it'll help you get started:
How To: Compile and Run Basic C++ Programs in Xcode
Let me know if it helped you solve your problem.
Upvotes: 1