This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ -fconserve-space makes no effect


Takenaka Kazuhiro <takenaka@intellilink.co.jp> writes:

> Can you help me with the following problem. I tried to compile
> C++ program on Fedra core 1 by g++ 3.3.2 and then compilation
> was aborted.
>
> (The program is first developped on Solaris 8 by Sun compiler.)
>
> Source files are like following.
>
> <<< main.C
> #include <stdio.h>
>
> int var;
>
> int main(void)
> {
>     var = 0;
>     printf("var = %d\n", var);
>     return 0;
> }
>>>> end
>
> <<< var.C
> int var;
>>>> end

This is not legal in C++. One of these must be "static" or "external"
(depending on whether you want them to be identical or not).


-- 
	Falk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]