I no longer get any autocompletion results when I begin to type a standard header file name in the include statements:
#include <>
Normally, typing in a name such as vector or string would cause the autocompletion list to open and display results for these library names, but it is not happening in Xcode 10. I'm getting some autocompletion results for other headers, but nothing related to the standard C++ libraries. Does anyone know any workarounds or solutions to this? I asked in the Apple developer forums, but I've received no help after a week now.
I know that directory for standard C++ library files is:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
But I'm unaware where this would be placed in Xcode to hopefully get it to allow for autocompletion of headers for all projects in Xcode (and not just whatever specific project is loaded.
Any help is greatly appreciated.
This can happen when the file is not a member of the Target. Open the file where autocomplete is not working and show the the "Utilities" tab in the top right of Xcode (blue in the screenshot below). Ensure your Target (typically your app's name) is checked.
Show/hide completions: ⎋ ( Escape ) OR ⌃Space ( Control + Space ) Type some code, use either ⎋ or ⌃Space to toggle auto-complete (I'm hooked on Escape ), and Xcode will offer a few intelligent suggestions to complete your code.
Add the above mentioned path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
to your project 'Build Settings' -> Header Search Paths -> Debug -> Any Architecture.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With