1

I am trying to run my old .cpp files with double clicking on them to get opened by xcode. But when the code opens in the xcode editor no Run option exists. I tried to wrap my head around it and the only solution I found is to create a new project and then adding this file to that. What should I do?

3
  • In xcode it is Run which should be equivalent of compile. Commented Nov 4, 2015 at 14:03
  • Either create an Xcode project or if they are self-contained .cpp files you could create a Makefile to compile them from the command line. Commented Nov 4, 2015 at 14:03
  • No, Run as in "run project". Compiling the source file is part of that process. Commented Nov 4, 2015 at 14:04

1 Answer 1

3

You can't run a .cpp file by Xcode without adding it to a project.

if you want to run a .cpp file without creating a project.You can just use terminal and find the directory of your file,enter: g++ a.cpp

Sign up to request clarification or add additional context in comments.

1 Comment

Annoying. For quick run and go, try CodeRunner. Way fewer features than Xcode or most editors (like VS Code) or IDEs but really simple for experimenting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.