469,609 Members | 1,437 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

error: 'something' does not name a type

Hi,
I have a struct with this definition
Expand|Select|Wrap|Line Numbers
  1. struct SeverityAction : public Action {
  2.     uint32_t theSeverity;      //*****
  3.   public:
  4.     SeverityAction(uint32_t aSeverity);
  5. ...
  6. };
  7.  
and the uint32_t is defined in "/usr/include/stdint.h"
Expand|Select|Wrap|Line Numbers
  1. /* Unsigned.  */
  2. typedef unsigned char        uint8_t;
  3. typedef unsigned short int    uint16_t;
  4. #ifndef __uint32_t_defined
  5. typedef unsigned int        uint32_t;
  6. # define __uint32_t_defined
  7. #endif
  8. #if __WORDSIZE == 64
  9. typedef unsigned long int    uint64_t;
  10. #else
  11. __extension__
  12. typedef unsigned long long int    uint64_t;
  13. #endif
However I get this error:
Expand|Select|Wrap|Line Numbers
  1. error: ‘uint32_t’ does not name a type
  2. error: expected ‘)’ before ‘aSeverity’
How can I fix that?
Mar 29 '11 #1

✓ answered by Banfa

uint32_t might be defined in "/usr/include/stdint.h" but have you included it in a relevant place?

3 17055
Banfa
9,064 Expert Mod 8TB
uint32_t might be defined in "/usr/include/stdint.h" but have you included it in a relevant place?
Mar 29 '11 #2
You are right. that file was included in another file but previous versions of gcc didn't complain about that.

thanks :)
Mar 29 '11 #3
Banfa
9,064 Expert Mod 8TB
If you need a header you should include it.

You should not assume that just because it is included into another header that you include that in future versions that other header will continue to include the header you need.
Mar 29 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by dotNetDave | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.