Eclipse NEON CDT does not recognize C ++ 11/14 header contents

Eclipse NEON.1 4.6.1 with CDT 9.1.0, g ++ 5.4.0

It does not recognize all the features of C ++ 11/14. It recognizes keywords such as autoand nullptr. However, it does not recognize things coming from headers that depend on the correct characters.

For example, when turned on, <memory>it recognizes old characters, such as std::auto_ptr, did not know such as std::shared_ptr. These new features are within #if __cplusplus >= 201103L.

I can make it work for a standard eclipse project by setting the dialect option, but I need to work with a project based on Autotools that does not have dialect settings.

I have an actual compilation of a program using the automake variable AM_CXXFLAGS. To make it work for the indexer, I went to eclipse in the properties Project> C / C ++ General> Preprocessor Include Paths, Macros

Then, the option -std = C ++ 14 is added to the suppliers tab for the command to configure the CDC GCC built-in compiler. I also moved this provider to the top of the list. On the input tab, you can see the actual value of the __cplusplus definition. Before I added the -std = C ++ 14 switch, it was below the required 201103L after I added the switch, which was much higher.

+4
source share
1 answer

, . -std=c++14 , , "", . , "Build". , "Build" , .

+2

Source: https://habr.com/ru/post/1656608/


All Articles