-
-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eclipse IDE: define __cplusplus to build correct index #1010
Comments
This does not help the eclipse indexer and it results in a warning from gcc: Honestly, I have no clue how the eclipse indexer really works, but it seems that it uses the default gcc of the local system (and thus not the one installed as pio's platform) to build the index. For some reason I dont't know, it does not enable the latest C++ version by default. Thus, defining __cplusplus for the indexer tool "G++" helps. This can be done by adding the follwing line to the
in the section of the symbols of the tool "G++":
See also euphi/ESP-LEDCtrl@287fd53 for a commit I did on one of my projects to fix the indexer (be aware that this commit also contents some other cleanup of no longer used include paths etc.). |
See also https://stackoverflow.com/questions/17131744/eclipse-cdt-indexer-does-not-know-c11-containers |
Could you reproduce this issue with the latest PIO Core 3.5.1? Please |
Hello.
PlatformIO, version 3.6.2 Same problem with "Symbol 'unique_ptr' could not be resolved" and other warnings. But when I use target "PlatformIO: Rebuild C/C++ Project Index", PlatformIO reverts my changes in "language.settings.xml" :( As I understand, this file is formed from: |
See temporary solution here #1010 (comment) Just add
Rebuild the project index. Restart Eclipse. |
Thanks for quick reply, but I've tried this and other methods. It does not work. Moreover adding "-std=c++11" to "build_flags" results in duplicating "-std=c++11" in build process (it is shown on video from 05:20). I know, you are busy now. But It will be great, if you will merge my pull request or just add this "-std=c++11" to https://github.com/platformio/platformio-core/blob/develop/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl when you'll have free time. |
Please re-test with the latest development version via |
I've re-tested, and there is another error now :( I've recorded video again for better explanation. Thank you. |
Fixed in 286a539 Please repeat Does it work now? |
Checked and... |
Happy coding with PlatformIO! 😊 |
With the default eclipse configuration created with
pio init --ide=eclipse
there is no symbol "__cplusplus" defined. Therefore the integrated eclipse indexer cannot handle C++11 standard lib symbols likestd::unique_ptr<T>
.To solve this, it helps to define __cplusplus to a recent version, e.g. "201402L".
platformio shall define this by default when initializing a project.
The text was updated successfully, but these errors were encountered: