Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiling software on AIX

408 views
Skip to first unread message

vz.b...@gmail.com

unread,
Apr 25, 2006, 12:10:28 PM4/25/06
to
Hello,
I can not compile even a simple C program on AIX 5.2

minime:root:/root> cat hello.c
int main(int argc, char **argv) { printf("hello, world!"); putchar(10);
}
minime:root:/root> cc hello.c
munch: Error reading input file hello.c
ld: 0711-715 ERROR: File hello.c cannot be processed.
The file must be an object file, an import file, or an archive.

Does anybody have any idea why it's not working?
TIA
--
Vlad Z

steve.gr...@gmail.com

unread,
Apr 25, 2006, 3:08:26 PM4/25/06
to
What compiler?
Perhaps including some headers might help...

Patrick Begou

unread,
Apr 26, 2006, 1:48:36 AM4/26/06
to
vz.b...@gmail.com wrote:
> Hello,
> I can not compile even a simple C program on AIX 5.2
>
> minime:root:/root> cat hello.c
> int main(int argc, char **argv) { printf("hello, world!"); putchar(10);
> }
> minime:root:/root> cc hello.c
> munch: Error reading input file hello.c
> ld: 0711-715 ERROR: File hello.c cannot be processed.
> The file must be an object file, an import file, or an archive.

The strange thing is that the message come from the loader (ld) not the
compiler.

What about
cc -c hello.c ?
Does it work and create a hello.o file ?
Then cc -o hello hello.o

Patrick

vz.b...@gmail.com

unread,
Apr 26, 2006, 9:55:28 AM4/26/06
to
It doesn't like '-c' ether.
minime:root:/root> cc -c hello.c
Unknown option -c -- ignored

munch: Error reading input file hello.c
ld: 0711-715 ERROR: File hello.c cannot be processed.
The file must be an object file, an import file, or an archive.

Apparently,
lrwxrwxrwx 1 root system 22 Sep 07 2005 /usr/bin/cc ->
/usr/vacpp/bin/linkxlC
where
minime:root:/root> lslpp -w /usr/vacpp/bin/linkxlC
File Fileset
Type

----------------------------------------------------------------------------
/usr/vacpp/bin/linkxlC vacpp.cmp.tools
File

Is it the way it's supposed to be?

Laurenz Albe

unread,
Apr 26, 2006, 12:41:31 PM4/26/06
to

Your cc is no compiler, but a linker.

You must install the C compiler.

Yours,
Laurenz Albe

Dave Seaman

unread,
Apr 26, 2006, 12:45:26 PM4/26/06
to

> ----------------------------------------------------------------------------
> /usr/vacpp/bin/linkxlC vacpp.cmp.tools
> File

The error suggests that you somehow have bypassed the compiler and called the
linker, and this confirms it.

> Is it the way it's supposed to be?

Definitely not. I tried this on an AIX 5.1 system and got:

[cloud:dseaman] $ ls -l /usr/bin/cc
lrwxrwxrwx 1 root system 15 Jan 06 2003 /usr/bin/cc -> /usr/vac/bin/cc


--
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
<http://www.mumia2000.org/>

Patrick Begou

unread,
Apr 26, 2006, 12:37:09 PM4/26/06
to

A little bit different here! It looks like if your cc command was linked
to the loader command (as the name suggest it: "linkxlC"). I have no
/usr/bin/cc. Is it an official (IBM made) link or an "aix admin" created
link?
Did xlc works ?
Have you /usr/vacpp/bin/cc ?

Patrick


begou@les: oslevel
5.2.0.0

begou@les: whence cc
/usr/vacpp/bin/cc

begou@les: lslpp -w /usr/vacpp/bin/cc
File Fileset Type

----------------------------------------------------------------------------
/usr/vacpp/bin/cc vacpp.cmp.core Symlink
begou@les: lslpp -w /usr/vacpp/bin/cc
File Fileset Type

----------------------------------------------------------------------------
/usr/vacpp/bin/cc vacpp.cmp.core Symlink
begou@les: lslpp -l vacpp.cmp.core
Fileset Level State Description

----------------------------------------------------------------------------
Path: /usr/lib/objrepos
vacpp.cmp.core 6.0.0.6 COMMITTED VisualAge C++ Compiler

Path: /etc/objrepos
vacpp.cmp.core 6.0.0.0 COMMITTED VisualAge C++ Compiler

Gary R. Hook

unread,
Apr 26, 2006, 2:45:35 PM4/26/06
to
Patrick Begou wrote:
> The strange thing is that the message come from the loader (ld) not the
> compiler.

That would be the "link editor", not loader.

vz.b...@gmail.com

unread,
Apr 26, 2006, 3:59:52 PM4/26/06
to
I doubt that the link to cc was created manually.
I have 3 AIX boxes, all supposed to be identical.
On all of them I get
minime:root:/usr> l /usr/vacpp/bin
total 288
-r-xr-xr-x 1 bin bin 86634 Apr 03 2003 c++filt
-r-xr-xr-x 1 bin bin 5524 Apr 03 2003 linkxlC
-r-xr-xr-x 4 bin bin 8909 Apr 03 2003
makeC++SharedLib
-r-xr-xr-x 4 bin bin 8909 Apr 03 2003
makeC++SharedLib128
-r-xr-xr-x 4 bin bin 8909 Apr 03 2003
makeC++SharedLib_r
-r-xr-xr-x 4 bin bin 8909 Apr 03 2003
makeC++SharedLib_r7
and on 2 out of 3 /usr/bin/cc is linked to /usr/vacpp/bin/linkxlC, the
third one does not have /usr/bin/cc at all.
xlc is not present on either ot them.

Does AIX come with a C compiler or it's a separate product?
If it's a part of AIX distribution, which one out of 7 CDs do I use to
install the complier?
Thanks a lot
--
VZ

Dave Seaman

unread,
Apr 26, 2006, 4:35:54 PM4/26/06
to
On 26 Apr 2006 12:59:52 -0700, vz.b...@gmail.com wrote:
> Does AIX come with a C compiler or it's a separate product?

It's a separate product. This will show whether you have the fileset
installed:


============================================================================
[cloud:dseaman] $ lslpp -h vac.C
Fileset Level Action Status Date Time
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
vac.C
6.0.0.0 COMMIT COMPLETE 01/02/03 16:39:00

Path: /etc/objrepos
vac.C
6.0.0.0 COMMIT COMPLETE 01/02/03 16:39:12
============================================================================

And this shows the files that are actually installed by the vac.C fileset:

============================================================================
[cloud:dseaman] $ lslpp -f vac.C
Fileset File
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
vac.C 6.0.0.0 /usr/vac/exe/xlCcpp
/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc
/usr/vac/bin/xlc_r4 -> /usr/vac/bin/xlc
/usr/vac/bin/xlc_r7 -> /usr/vac/bin/xlc
/usr/vac/bin/xlc128 -> /usr/vac/bin/xlc
/usr/vac/bin/xlc128_r -> /usr/vac/bin/xlc
/usr/vac/bin/cc -> /usr/vac/bin/xlc
/usr/vac/bin/cc_r -> /usr/vac/bin/xlc
/usr/vac/bin/cc_r4 -> /usr/vac/bin/xlc
/usr/vac/bin/cc_r7 -> /usr/vac/bin/xlc
/usr/vac/bin/cc128 -> /usr/vac/bin/xlc
/usr/vac/bin/cc128_r -> /usr/vac/bin/xlc
/usr/vac/bin/c89 -> /usr/vac/bin/xlc
/usr/vac/bin/xlc
/usr/vac/README.C.ja_JP
/usr/vac/exe/default_msg/vacimsg.cat
/usr/vac/license.pdf
/usr/vac/exe/bolt
/usr/vac/exe/xlcentry
/usr/vac/exe/default_msg
/usr/vac/exe/default_msg/vacfe.cat
/usr/vac/bin/resetpdf -> /usr/xlopt/bin/resetpdf
/usr/vac/README.C
/usr/vac/exe/xlCcode
/usr/vac/exe
/usr/vac/lib
/usr/vac/exe/dis
/usr/vac/bin/CreateExportList
/usr/vac/html
/usr/vac/exe/default_msg/vac.help
/usr/vac/bin/cleanpdf -> /usr/xlopt/bin/cleanpdf
/usr/vac/exe/default_msg/vacdmsg.cat
/usr/vac
/usr/vac/bin
/usr/vac/README.C.zh_CN
/usr/vac/exe/default_msg/vacsmsg.cat
/usr/vac/exe/ipa

Path: /etc/objrepos
vac.C 6.0.0.0 /etc/vatools/vac/help.cfg
/etc/vatools
/etc/vac.cfg.43
/etc/vac.cfg.50
/etc/vatools/vac
/etc/vac.cfg.51
============================================================================

Patrick Begou

unread,
Apr 27, 2006, 4:02:46 AM4/27/06
to

Yes, you're right. Sorry for my poor english.

Patrick

Gary R. Hook

unread,
Apr 27, 2006, 1:05:40 PM4/27/06
to

Your English is fine. The ld command is often mis-named in
that way.

0 new messages