Re: g++/gcc system errors
> While working on some C++ code for a programming assignment, I got the
> following error:
>
> /usr/lib/crt1.o(.text+0x36): undefined reference to `main'
> collect2: ld returned 1 exit status
>
> And that is simply after typing "g++ <file>.cc"
First, make sure you have a function called main (and it's typed
correctly. The first time I found this error I had a function called
"mian").
Second, if you want just the object file (ie. no linking) then use
"g++ -c <file>.cc -o <file>.o".
> The other error is as follows:
>
> If I mistakenly type "gcc <file>.cc" :
>
> gcc: installation problem, cannot exec `cc1plus': No such file or directory
Can't help you there....
John
Reply to: