problem porting using gcc on LYNX OS
Sandra Seymour
sandras@globes.com
Mon Oct 25 11:28:00 GMT 1999
I am trying to compile a program that seem to be having a scope problem on
LYNX using GCC. I works with other compilers. The '-traditional' cc
option doesn't work. Below is a small example program that demonstrates the
problem:
TEST.C
#include <stdio.h>
struct check {
int a;
char b;
};
int tmp;
void print_next();
void main()
{
tmp = 5;
printf("main: tmp = %d\n",tmp);
print_next();
}
TEST1.C
struct check {
int a;
char b;
};
int tmp;
void print_next()
{
tmp=6;
printf("print_next: tmp = %d\n",tmp);
}
This program generated the following errors:
/usr/tmp/cc1392.o(.bss+0x0):test1.c: multiple definition of `tmp'
/usr/tmp/cc1391.o(.bss+0x0):test.c: first defined here
Thanks,
Sandra
More information about the Gcc-help
mailing list