By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,692 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,692 IT Pros & Developers. It's quick & easy.

error: 'something' does not name a type

P: 77
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. };
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?

Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 8,944
uint32_t might be defined in "/usr/include/stdint.h" but have you included it in a relevant place?
Mar 29 '11 #2

P: 77
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

Expert Mod 5K+
P: 8,944
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.