This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Extern struct

Hi all:

I am trying to use data from a structure in different modules ( extern struct), with no success. Here's what I am doing:

main.c:

#include "main.h"
struct my_struct new_struct;

void main(void)
{
   new_struct.a = 4321;
}

file1.c:

#include "main.h"
extern my_struct new_struct;


void test()
{
    new_struct.a = 1234;
}

main.h:

struct my_struct
{
    int a;
    int b;
}


The compiler tells me that left side of . requires struct or union....
As I have followed previous threads about this, I see this guidelines are correct. What can be wrong here ?
I am using c51 ver 8.12

Thanks in advance

Juan


0