I use CodeLite on Ubuntu and for some reason bizzare GCC keeps throwing this error whenever I try to compile code using a function that returns a pointer to struct:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
Here is an example I wrote to demonstrate this error:
#include <stdio.h>
typedef struct test_t {
unsigned char someVar;
};
test_t* testFunc() {
return NULL;
}
int main(int argc, char **argv)
{
return 0;
}
Therefore, if I do not forget something obvious, I usually expect this code to compile on any other compiler, namely MSVC, so I'm completely confused about why it does not work.
I hope one of your experts can please me.
Thanks!
source
share