471,852 Members | 1,285 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

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 17589
Banfa
9,065 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,065 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
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.