🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41601

gcc2.7.2 Solaris2.4 problem with -pg and libraries (libdl?)

#41601
From: Rob Quinn
Date: Tue, 27 Feb 1996 00:00
29 lines
1968 bytes
 I just installed gcc2.7.2 on my Solaris2.4 machine. I had an older version
working fine. I don't have any other packages installed except gnu gprof.
 My problem comes when I compile with both -pg and -lsocket. The example below
is for a simple program containing only ``return 0;'':
%gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.4/2.7.2/specs
gcc version 2.7.2
%gcc show.c -o show -lsocket
%gcc -pg show.c -o show 
%gcc -pg show.c -o show -lsocket
Undefined                       first referenced
 symbol                             in file
dlclose                             /usr/lib/libp/libc.a(nss_deffinder.o)  (/usr/lib/libdl.so.1?)
dlsym                               /usr/lib/libp/libc.a(nss_deffinder.o)  (/usr/lib/libdl.so.1?)
dlopen                              /usr/lib/libp/libc.a(nss_deffinder.o)  (/usr/lib/libdl.so.1?)
ld: fatal: Symbol referencing errors. No output written to show

 Notice that -lsocket and -pg work alone, but not together. This simple program
does not use sockets of course.
 I can fix the problem by compiling with -ldl or -static.

 If you have any suggestions, please let me know. My news server is having
problems, so please email me any solutions in addition to posting them.

--
|                                                                          |
|                                                                Rob Quinn |
|                                                         rjq@phys.ksu.edu |
|                                                    QuinnBob@KSUVM.BITNET |
Technical Details
Message-ID: <4gvnhg$85v@newserv.ksu.ksu.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,99e11b6f36f9ff3,start
X-Google-Attributes: gid11318c,public
From: rjq@phys.ksu.edu (Rob Quinn)
Subject: gcc2.7.2 Solaris2.4 problem with -pg and libraries (libdl?)
Date: 1996/02/27
Message-ID: <4gvnhg$85v@newserv.ksu.ksu.edu>
X-Deja-AN: 141386239
organization: Kansas State University
newsgroups: gnu.gcc.help