简体   繁体   中英

Xcode & C/C++ project

I want to use Xcode for C/C++ project. I don't care about build/compilation, all i want is to use it as editor. Needs: - Find symobol , References , callers etc

I've opened a console project, i can search for a symbol in the same file but nothing else. (for example, right click + jump to definition gives me a question mark ('?').

Any pointer to what needs to be done ?

Thanks, Shaul.

From my experience, XCode is not designed to work well with C++. For example, you'll find that simple refactoring, such as renaming a function and automatically renaming usages, doesn't work well with XCode. I find AppCode works a lot better for (Obj)C++ development. Worth a look.

Thare are two approches

  1. You need to create a library of your c++ project and add that library in your project

  2. Add C++ project in your xcode and make it build as target source

let me now if you need a walkthrough

Ok, I found the solution.

When adding files to the Xcode project, on the bottom , need to click 'Options' and then choose 'Create groups' instead 'Create folder references'

This options will add all the sources and headers to 'Compile sources' and 'Headers' (Under 'Build Phases')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM