Compile error, can't find crt1.o

Hi

I have a new Sol 10 06/06 installed with minimal packages plus extras as necessary for a server.

I'm getting an error when I try to compile using gcc:

% echo 'int main(int argc, char **argv) { printf("hello, world!"); putchar(10); }' > hello.c

% gcc -o hello hello.c

ld: fatal: file crt1.o: open failed: No such file or directory

collect2: ld returned 1 exit status

Where did crt1.0 come from? I installed blastwave gcc3, gcc4, which didn't work. Then I uninstalled gcc3, gcc4.

Finally, I tried uninstalling and reinstalling SUNWgcc, but that hasn't helped.

# gcc -v

Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs

Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared

Thread model: posix

gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

Where do I get make, and not gmake?

Thanks in advance.

[1084 byte] By [DLK] at [2007-11-26 11:17:30]
# 1

Hi

Answer my own question... From: http://steve-parker.org/c/

Quick note: If you're compiling with Gcc on Solaris and get the message:

ld: fatal: file crt1.o: open failed: No such file or directory

Then you need to install the SUNWarc and SUNWarcr packages. Other useful but not-necessarily obvious packages include SUNWhea and SUNWbinutils.

--

It worked... Who knew? I hope this can help anyone else to runs into this.

DLK at 2007-7-7 3:32:39 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...