Extern redefinition

M

Mapisto

Hi all,

I'm moving from gcc 3 to gcc 4, and I've got a redefinition error:
defs.h is a header file which contains a lot detentions and one of
them is "extern int my_var". main.c includes defs.h but also define
the var - "int my_var".

Is there an alternative beside to remove the extern to another h file?

Thanks in advance,
Mapisto.
 
U

Ulrich Eckhardt

Mapisto said:
I'm moving from gcc 3 to gcc 4, and I've got a redefinition error:
defs.h is a header file which contains a lot detentions and one of
them is "extern int my_var". main.c includes defs.h but also define
the var - "int my_var".

What I get from your description is not bogus code, so I'd say that your
description isn't detailed enough. For a starter, try using cut'n'paste and
also include the error message you get. Of course, creating a minimal
example is a step everybody does long before asking here in order to solve
the problem themselves, so you might want to include that, too. ;)

Uli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top