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

Linking in Solaris (crt1.o)

394 views
Skip to first unread message

Carlos-Oscar Sanchez-Sorzano

unread,
Jul 29, 1999, 3:00:00 AM7/29/99
to
Hello, you all.

I'm trying to compile a C++ program in Solaris 2.6 with the GNU compiler
and either with the system linker or the GNU linker, always I get the
same message:

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

Could anybody tell me where this file should it be? And, do I have to
put it in my LD_LIBRARY_PATH or where?

Thanks, Carlos Oscar.

Joe Durusau

unread,
Aug 2, 1999, 3:00:00 AM8/2/99
to
Hmmmmm... I didn't know that you needed that one for c++. Anyway, it
usually resides in /usr/lib/gcc-lib/<something-or-other>. Make sure you are

using g++ to compile and link c++ programs. If that doesn't help,
try setting the env variable GCC_EXEC_PREFIX as recommended in
the documentation.

Speaking only for myself,

Joe Durusau

How Wong

unread,
Aug 5, 1999, 3:00:00 AM8/5/99
to Carlos-Oscar Sanchez-Sorzano
Carlos-Oscar Sanchez-Sorzano wrote:

> Hello, you all.
>
> I'm trying to compile a C++ program in Solaris 2.6 with the GNU compiler
> and either with the system linker or the GNU linker, always I get the
> same message:
>
> ld: fatal: file crt1.o: open failed: No such file or directory
>
> Could anybody tell me where this file should it be? And, do I have to
> put it in my LD_LIBRARY_PATH or where?
>
> Thanks, Carlos Oscar.

the crt1.o is in /usr/lib


Casper H.S. Dik - Network Security Engineer

unread,
Aug 8, 1999, 3:00:00 AM8/8/99
to
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

How Wong <h...@hotmail.com> writes:

>Carlos-Oscar Sanchez-Sorzano wrote:


No it isn't. It should be in the gcc lib directory.

(where cc1 and others are)

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Matt Mencel

unread,
Aug 13, 1999, 3:00:00 AM8/13/99
to
Well I have a similar problem. I've done a search on my system and crt1.o
is NOWHERE! How can this not be there if gcc and g++ are installed?

Casper H.S. Dik - Network Security Engineer <Caspe...@Holland.Sun.Com>
wrote in message news:casper.9...@nl-usenet.sun.com...

Doug McIntyre

unread,
Aug 13, 1999, 3:00:00 AM8/13/99
to
"Matt Mencel" <ma...@cmitech.com<<SPAMBUSTER>>> writes:
>Well I have a similar problem. I've done a search on my system and crt1.o
>is NOWHERE! How can this not be there if gcc and g++ are installed?

For a standard GCC 2.8.1 install with a prefix of /usr/local/ we get

$ cd /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/
$ ls -al
drwxr-xr-x 3 root other 512 Aug 1 1998 ./
drwxr-xr-x 3 root other 512 Aug 1 1998 ../
-rw-r--r-- 1 root other 88205 Aug 1 1998 SYSCALLS.c.X
-rwxr-xr-x 1 root other 1868524 Aug 1 1998 cc1*
-rwxr-xr-x 1 root other 1942572 Aug 1 1998 cc1obj*
-rwxr-xr-x 1 root other 2374708 Aug 1 1998 cc1plus*
-rwxr-xr-x 1 root other 101952 Aug 1 1998 cpp*
-rw-r--r-- 1 root other 884 Aug 1 1998 crt1.o
-rw-r--r-- 1 root other 2156 Aug 1 1998 crtbegin.o
-rw-r--r-- 1 root other 1340 Aug 1 1998 crtend.o
-rw-r--r-- 1 root other 552 Aug 1 1998 crti.o
-rw-r--r-- 1 root other 516 Aug 1 1998 crtn.o
-rw-r--r-- 1 root other 944 Aug 1 1998 gcrt1.o
-rw-r--r-- 1 root other 20608 Aug 1 1998 gmon.o
drwxr-xr-x 3 root other 1024 Aug 1 1998 include/
-rw-r--r-- 1 root other 391136 Aug 1 1998 libgcc.a
-rw-r--r-- 1 root other 392020 Aug 1 1998 libobjc.a
-rw-r--r-- 1 root other 3098 Aug 1 1998 specs


If you don't have them, check your install. You must have something
not installed correctly.

>Casper H.S. Dik - Network Security Engineer <Caspe...@Holland.Sun.Com>
>wrote in message news:casper.9...@nl-usenet.sun.com...
>> [[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]
>>
>> How Wong <h...@hotmail.com> writes:
>>
>> >Carlos-Oscar Sanchez-Sorzano wrote:
>>
>> >> Hello, you all.
>> >>
>> >> I'm trying to compile a C++ program in Solaris 2.6 with the GNU
>compiler
>> >> and either with the system linker or the GNU linker, always I get the
>> >> same message:
>> >>
>> >> ld: fatal: file crt1.o: open failed: No such file or directory
>> >>
>> >> Could anybody tell me where this file should it be? And, do I have to
>> >> put it in my LD_LIBRARY_PATH or where?
>> >>
>> >> Thanks, Carlos Oscar.
>>
>> >the crt1.o is in /usr/lib
>>
>>
>> No it isn't. It should be in the gcc lib directory.
>>
>> (where cc1 and others are)
>>
>> Casper
>> --
>> Expressed in this posting are my opinions. They are in no way related
>> to opinions held by my employer, Sun Microsystems.
>> Statements on Sun products included here are not gospel and may
>> be fiction rather than truth.


--
Doug McIntyre mer...@visi.com
Network Engineer/Tech Support/Jack of All Trades of Vector Internet
Due to circumstances beyond your control, you are master of your fate
and captain of your soul.

Michael Edmond

unread,
Aug 15, 1999, 3:00:00 AM8/15/99
to
Assuming you find crt1.o in the gcc lib directory don't use the
LD_LIBRARY_PATH this wont work. Instead set the variable GCC_EXEC_PREFIX to
$GCCHOME/lib/gcc-lib/ (where GCCHOME is where gcc is installed - default
/usr/local) and it should find them. Alternatively use the -B argument to
gcc.

--
Michael Edmond

mic...@edmond-1.freeserve.co.uk

Joe Durusau

unread,
Aug 16, 1999, 3:00:00 AM8/16/99
to
It can not be there if you didn't install gcc correctly. It comes as part
of the binary distribution. It is also possible that someone moved the file
to some other place, or deleted it after installation, or that the pkgadd
script failed because you didn't have write permission somwhere or another.

When you say you searched the system, do you mean that while logged
in as root you typed

find / -name crt1.o -print


and it wasn't found??? If so, somebody got delete happy.

If you still have the original .gz file lying around, try re-installing.

Speaking only for myself,

Joe Durusau


"Matt Mencel

> Well I have a similar problem. I've done a search on my system and crt1.o
> is NOWHERE! How can this not be there if gcc and g++ are installed?
>

Casper H.S. Dik - Network Security Engineer

unread,
Aug 18, 1999, 3:00:00 AM8/18/99
to
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

"Matt Mencel" <ma...@cmitech.com<<SPAMBUSTER>>> writes:

>Well I have a similar problem. I've done a search on my system and crt1.o
>is NOWHERE! How can this not be there if gcc and g++ are installed?

Where did you get your gcc/g++ from?

Anthony Gabrielson

unread,
Aug 19, 1999, 3:00:00 AM8/19/99
to
I have the same problem. crt1.o is
in/usr/local/lib/sparc-sun-solaris7/2.8.1/crt1.o
I got my copy of gcc/g++ from sunfreware.com - I'm getting unresolved symbol and
reference errors just from using g++ (compiling no code)


Anthony

Joe Durusau

unread,
Aug 19, 1999, 3:00:00 AM8/19/99
to
Sounds like someone muffed the installation, or maybe the pkg file
was defective. crt1.o belongs in the same directory as cc1, cc1plus, and
the other parts of gcc. If they are in the directory you cite, set
GCC_EXEC_PREFIX to that location, taking care that the variable
ends in a / (sh example below)

GCC_EXEC_PREFIX=/usr/local/lib/sparc-sun-solaris7/2.8.1/
export GCC_EXEC_PREFIX

These files are usually in /usr/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/

Speaking only for myself,

Joe Durusau

0 new messages