I'm using CodeLite on Ubuntu and for some bizzare reason GCC keeps throwing this error whenever I try to compile code with a function that returns a pointer to a struct:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
Here is an example I wrote up to demonstrate this error:
#include <stdio.h>
typedef struct test_t {
unsigned char someVar;
};
test_t* testFunc() { // GCC throws that error on this line
return NULL;
}
int main(int argc, char **argv)
{
return 0;
}
So unless I'm forgetting something obvious I would normally expect this code to compile on any other compiler, namely MSVC, so I'm completely confused as to why it doesn't work.
Hopefully one of you experts can please enlighten me.
Thanks!