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
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
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?
Your cc is no compiler, but a linker.
You must install the C compiler.
Yours,
Laurenz Albe
> ----------------------------------------------------------------------------
> /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/>
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
That would be the "link editor", not loader.
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
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
============================================================================
Yes, you're right. Sorry for my poor english.
Patrick
Your English is fine. The ld command is often mis-named in
that way.