extern question

John Love-Jensen eljay@adobe.com
Tue Jun 6 14:12:00 GMT 2006


Hi Aseem,

> interestingly (or at least i think so :-) ), the code snippet that
> Trevis has given compiles and links using gcc BUT fails to link under
> g++ (2 times defined problem).

C++ has different rules than C about what constitutes a declaration versus a
definition.

(At least C89.  I'm not familiar with C99, which may have slightly different
rules.)

Sincerely,
--Eljay



More information about the Gcc-help mailing list