- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm trying to use in my header file the simple following code : typedef enum { COUNTER1 = 0, COUNTER2 = 1, } ERRORCOUNTER; and in my .c main file something like : U32 GetErrorCount(errorcounter Counter,FE_STV0900_DEMOD_t Demod) { ... /*Read the Error value*/ switch(Counter) { case COUNTER1: ... } but when I compile, I always get the same compilation error : "error: `ERRORCOUNTER' undeclared (first use in this function)" whereas I checked the# include header declarations twice !! So here is my question : can we use typedef enum and typedef struct in µClinux ?? Thanks for your help !Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The simple answer is of course you can typedef structs and enums. Your example is not complete enough to see what's wrong. The obvious question is: did you include the header? good luck, Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<div class='quotetop'>QUOTE (papyenfurie @ Jul 16 2009, 01:55 PM) <{post_snapback}> (index.php?act=findpost&pid=23153)</div>
--- Quote Start --- So here is my question : can we use typedef enum and typedef struct in µClinux ??[/b] --- Quote End --- For that matter, the question should be whether our compiler (nios2-linux-uclibc-gcc) supports that kind of strucutre. I'm pretty sure it does, I use it all the time. Could you please post the smallest, simplest source code that reproduces the same error you are seeing? It would make things easier for people wanting to help. Cheers, Ricardo.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page