Running a C++ project in Xcode Mac Os

Click For Summary
SUMMARY

This discussion focuses on running a C++ project in Xcode on macOS. The user created a new command line tool project but encountered issues after importing code from a GitHub repository. Despite a successful build, the user received errors indicating that the executable does not exist and failed to launch. The discussion highlights the need for proper linking of imported files within Xcode to resolve these issues.

PREREQUISITES
  • Familiarity with Xcode IDE and its project structure
  • Understanding of C++ programming and project setup
  • Knowledge of GitHub repository management and file importing
  • Basic troubleshooting skills for build and run errors in IDEs
NEXT STEPS
  • Learn how to properly link files in Xcode projects
  • Explore Xcode's build settings and configurations
  • Research common C++ project setup issues in Xcode
  • Watch video tutorials on importing code into Xcode
USEFUL FOR

C++ developers, students learning Xcode, and anyone troubleshooting project setup issues in Xcode on macOS.

CAF123
Gold Member
Messages
2,918
Reaction score
87
I am trying to run an Xcode project in c++ on a Mac Os. I started by creating new project, selecting command line tool options so that I may use c++ option and proceeded with completing the product name fields and the directory where to save the project on my Mac.

The default project that is created is the Hello World, however I wish to import some code from GitHub to use in the XCode IDE. I have the GitHub repository downloaded as a zip file on my computer and I tried to import this code in XCode via 'Files' -> 'Add Files to...' and selecting the code from my computer.

I then deleted the default main.cpp file from the XCode project ( the one that contains the Hello World) and tried to build and run the imported code. It says it builds successfully but when I try to run I get the error

'error: executable doesn't exist:'

and

'error: failed to launch' with 'LLDB provided no error string.' What does this mean?

There are so many options in XCode so it is not clear if I need to somehow link the imported files to the compiler or something. Maybe someone here has used XCode and knows the solution easily. Thanks in advance.
 
Technology news on Phys.org
While I don't know what happened here, I can say there are video tutorials on Youtube for doing various xcode tasks. Here's one on creating a project.



In general with IDE development, you can copy files into a project directly using the command line or via the File Explorer (aka Finder). and the IDE will notice and include them in the mix of code (if placed in the appropriate directories).
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
Replies
7
Views
3K