Newbie: on "Hello, world" -data definition has no type. how tocheck proper configuration

A

Atropo

Hi, all.

As you can see I'm just begining on C. with the tutorial "Sams Teach
Yourself C in 24 Hours" as a starter. on aix 5.2 when compiling a
helloWorld the gcc throws some warnings the system adminitrator
does'nt know anything about. could you point me where to check the
gcc conf. or what i'm doing wrong

Atropo@seagull> more captura.c
#include <stdio.h>
main()
{
int ch;
printf("Please type in one character:\n");
ch = getc(stdin);
printf("The character you just entered is: %c\n", ch);
return 0;
}

Atropo@seagull> gcc captura.c
In file included from /usr/include/sys/m_types.h:40,
from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/sys/types.h:393,
from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/stdio.h:366,
from captura.c:1:
/usr/include/sys/vm_types.h:65: parse error before `vmid64_t'
/usr/include/sys/vm_types.h:65: warning: data definition has no type
or storage class
/usr/include/sys/vm_types.h:66: parse error before `rpn64_t'
/usr/include/sys/vm_types.h:66: warning: data definition has no type
or storage class
/usr/include/sys/vm_types.h:67: parse error before `cnt64_t'
/usr/include/sys/vm_types.h:67: warning: data definition has no type
or storage class
/usr/include/sys/vm_types.h:86: parse error before `psize_t'
/usr/include/sys/vm_types.h:86: warning: data definition has no type
or storage class

Atropo@seagull> uname -a
AIX cofeerd1b 2 5 000C569D4C00
 
F

Fred

Hi, all.

As you can see I'm just begining on C. with the tutorial "Sams Teach
Yourself C in 24 Hours" as a starter.  on aix 5.2 when compiling a
helloWorld the gcc  throws some warnings the system adminitrator
does'nt know anything about.  could you point me where to check the
gcc conf.  or what i'm doing wrong

Atropo@seagull> more captura.c
#include <stdio.h>
main()
{
int ch;
printf("Please type in one character:\n");
ch = getc(stdin);
printf("The character you just entered is: %c\n", ch);
return 0;

}

Atropo@seagull> gcc captura.c
In file included from /usr/include/sys/m_types.h:40,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/sys/types.h:393,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/stdio.h:366,
                 from captura.c:1:
/usr/include/sys/vm_types.h:65: parse error before `vmid64_t'
/usr/include/sys/vm_types.h:65: warning: data definition has no type
or storage class
/usr/include/sys/vm_types.h:66: parse error before `rpn64_t'
/usr/include/sys/vm_types.h:66: warning: data definition has no type
or storage class
/usr/include/sys/vm_types.h:67: parse error before `cnt64_t'
/usr/include/sys/vm_types.h:67: warning: data definition has no type
or storage class
/usr/include/sys/vm_types.h:86: parse error before `psize_t'
/usr/include/sys/vm_types.h:86: warning: data definition has no type
or storage class

Atropo@seagull> uname -a
AIX cofeerd1b 2 5 000C569D4C00

It looks like your compiler is for an AIX4.3 O/S, but you are using
AIX5.2.
You need to get an compiler and associated development kit for 5.2.
 
K

Keith Thompson

Atropo said:
As you can see I'm just begining on C. with the tutorial "Sams Teach
Yourself C in 24 Hours" as a starter. on aix 5.2 when compiling a
helloWorld the gcc throws some warnings the system adminitrator
does'nt know anything about. could you point me where to check the
gcc conf. or what i'm doing wrong

Atropo@seagull> more captura.c
#include <stdio.h>
main()
{
int ch;
printf("Please type in one character:\n");
ch = getc(stdin);
printf("The character you just entered is: %c\n", ch);
return 0;
}

Atropo@seagull> gcc captura.c
In file included from /usr/include/sys/m_types.h:40,
from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/sys/types.h:393,
from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/stdio.h:366,
from captura.c:1:
/usr/include/sys/vm_types.h:65: parse error before `vmid64_t'
[snip]

The program should compile without error, though you might get a
warning on your declaration of main (it should be "int main(void)"
rather than "main()". Once you get this problem straightened out,
look into passing more options to gcc so it gives you more warnings.
And always indent your code for clarity. (If you're using tabs for
indentation, try using spaces instead, at least for code you post to
Usenet.)

It looks like gcc is installed incorrectly on your system. (Perhaps
the OS was upgraded since the last time gcc was installed?) You
should get the same errors with this trivial program:

#include <stdio.h>
int main(void)
{
return 0;
}

Show that program and the error messages to your sysadmin and let
him/her worry about it.

Any questions about fixing this problem should be addressed to
gnu.gcc.help and/or comp.unix.aix.

In the meantime, AIX has its own native C compiler. I think it's
called "xlc", or you might be able to invoke it as "cc". Try using
that instead.
 
A

Atropo

Atropo said:
As you can see I'm just begining on C. with the tutorial "Sams Teach
Yourself C in 24 Hours" as a starter.  on aix 5.2 when compiling a
helloWorld the gcc  throws some warnings the system adminitrator
does'nt know anything about.  could you point me where to check the
gcc conf.  or what i'm doing wrong
Atropo@seagull> more captura.c
#include <stdio.h>
main()
{
int ch;
printf("Please type in one character:\n");
ch = getc(stdin);
printf("The character you just entered is: %c\n", ch);
return 0;
}
Atropo@seagull> gcc captura.c
In file included from /usr/include/sys/m_types.h:40,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/sys/types.h:393,
                 from /usr/local/lib/gcc-lib/powerpc-ibm-
aix4.3.2.0/2.8.1/include/stdio.h:366,
                 from captura.c:1:
/usr/include/sys/vm_types.h:65: parse error before `vmid64_t'

[snip]

The program should compile without error, though you might get a
warning on your declaration of main (it should be "int main(void)"
rather than "main()".  Once you get this problem straightened out,
look into passing more options to gcc so it gives you more warnings.
And always indent your code for clarity.  (If you're using tabs for
indentation, try using spaces instead, at least for code you post to
Usenet.)

It looks like gcc is installed incorrectly on your system.  (Perhaps
the OS was upgraded since the last time gcc was installed?)  You
should get the same errors with this trivial program:

#include <stdio.h>
int main(void)
{
    return 0;

}

Show that program and the error messages to your sysadmin and let
him/her worry about it.

Any questions about fixing this problem should be addressed to
gnu.gcc.help and/or comp.unix.aix.

In the meantime, AIX has its own native C compiler.  I think it's
called "xlc", or you might be able to invoke it as "cc".  Try using
that instead.

--
Keith Thompson (The_Other_Keith) (e-mail address removed)  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this.."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"- Hide quoted text -

- Show quoted text -

Thanks Keith and Fred.
really did'nt notice it shows 4.3 version of OS. I'll pass the case
to sysadmin. the xlc and cc are not on the system either.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top