Is it possible to lookup where a typedef is being defined?
I am running into this very evasive problem that is producing the following compiler error:
/usr/include/stdint.h: At global scope:
/usr/include/stdint.h:57: error: duplicate 'unsigned'
/usr/include/stdint.h:57: error: declaration does not declare anything
where /usr/include/stdint.h:57 is:
typedef unsigned int uint32_t
My initial thoughts are that something else is defining uint32_t, and when stdint tries to re-define it, the error is thrown. But I don’t know how I can trace back to where this typedef was called, or even what the current value of uint32_t is when this is called.
Any ideas?
You can get the preprocessed output (-E on most compilers) which will give you the complete declarations of all the headers. Within that you can grep for uint32_t. That should show which header was the one which caused the duplicate typedef.