I am working on a C++ program in Eclipse (3.8.1) CDT. I am using the gcc compiler on Debian 8. I\'m also using an open source library called opendnp3 written in C++, which requi
I know this question is old, but I feel it's worth mentioning that I was having this exact problem and was able to resolve it just be rebuilding the index: right-click the project, "Index", "Rebuild". You said that you had rebuilt the index and it didn't help; importantly, I did this after adding -std=c++11
to the command line for the compiler specified in the "CDT GCC Built-in Compiler Settings", which can be found by opening project properties and going to "C/C++ General", "Preprocessor Include Paths, Macros etc", "Providers" tab. You wouldn't, if I understand correctly, need to do this with GCC version 6+ as it defaults to C++14; I'm using GCC 5.4 myself.
If that doesn't help, the best path for debugging the issue is probably to open the declaration for cstdint
(the include file itself - so, right click cstdint
within the #include
directive, and choose "open declaration") - this will show you the included file, with sections greyed out if they are precluded via preprocessor macros (#ifdef
and the like). You may be able to see immediately why uint32_t
is not considered defined. In my case, the __cplusplus
macro had an unsuitable value and this led me to adding -std=c++11
to the compiler command line as mentioned above - but I still needed to rebuild the index before the problem was fully resolved.
After adding -std=c++11
, do this:
C/C++ General -> Paths and Symbols -> Symbols -> GNU C++
Click Add
on the left side and paste __GXX_EXPERIMENTAL_CXX0X__
(ensure to append and prepend two underscores) into Name
and leave Value
blank.
Try to enable the CDT GCC Built-in Compiler Settings in Project>Properties>Preprocessor Includes>Providers.