From owner-freebsd-questions@FreeBSD.ORG Wed Apr 26 22:06:18 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A8F416A401 for ; Wed, 26 Apr 2006 22:06:18 +0000 (UTC) (envelope-from biancalana@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id B08E543D48 for ; Wed, 26 Apr 2006 22:06:17 +0000 (GMT) (envelope-from biancalana@gmail.com) Received: by xproxy.gmail.com with SMTP id s9so1062144wxc for ; Wed, 26 Apr 2006 15:06:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=WeUP/9i2hmDQB/nDwU5b9KJmYoX4y20PymvUsk8DA0zsjeG8LiGtOwQC2VKBcy0X+i3ssDYQNc/W0pEellEq1Gicj7CDHqXoPptAu0CZB9CvkDWMxuwIJl85cDYIzRqImTylPjEL9ollrqa9GowFbY7eNdWY49rPeOm0bRwqPY8= Received: by 10.70.105.10 with SMTP id d10mr40569wxc; Wed, 26 Apr 2006 15:06:15 -0700 (PDT) Received: by 10.70.123.7 with HTTP; Wed, 26 Apr 2006 15:06:15 -0700 (PDT) Message-ID: <8e10486b0604261506g6376f8cay72a0425a04e1e07f@mail.gmail.com> Date: Wed, 26 Apr 2006 19:06:15 -0300 From: "Alexandre Biancalana" To: freebsd-questions@freebsd.org In-Reply-To: <8e10486b0604190744q124cf7c7j54524d2e4f0368d8@mail.gmail.com> MIME-Version: 1.0 References: <8e10486b0604190744q124cf7c7j54524d2e4f0368d8@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: gprof X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2006 22:06:18 -0000 Any Ideas ? On 4/19/06, Alexandre Biancalana wrote: > > Hi list, > > I'm trying to compile my C application with gprof but it is not working= . > This is a multithreaded program that use mysql and openssl libraries. > Reading the man page I see that is need add -pg to the compile command > line, but when a do this the following error occurs at linking time > > $ gcc -L/usr/local/lib/mysql -Wall -I. -I.. -I/usr/local/include/mysql -o > serverd ../log.o ../mem.o ../misc.o ../threads_wrapper.o ../openssl.o db.= o > main.o request.o ssl_server.o ssl_socket.o threads.o threads_control.o > -pthread -lmysqlclient_r -lssl -pg > /lib/libcrypto.so.4: undefined reference to `sysconf' > /lib/libcrypto.so.4: undefined reference to `times' > /lib/libz.so.3: undefined reference to `feof' > /lib/libm.so.4: undefined reference to `ldexp' > /lib/libcrypto.so.4: undefined reference to `chmod' > /lib/libz.so.3: undefined reference to `clearerr' > /lib/libm.so.4: undefined reference to `isnan' > *** Error code 1 > > Stop in /usr/home/ale/personal/ale_projects/works/program/server. > > I tried to substitute the -pg compiler flag by -lc_p, with this flag the > program compile but is not linked with libc_p and don't generate the gpro= f > output file... > > $ gcc -L/usr/local/lib/mysql -Wall -I. -I.. -I/usr/local/include/mysql > -lc_p -o serverd ../log.o ../mem.o ../misc.o ../threads_wrapper.o > ../openssl.o db.o main.o request.o ssl_server.o ssl_socket.o threads.othr= eads_control.o -pthread -lmysqlclient_r -lssl > /usr/lib/libc.so: warning: warning: this program uses f_prealloc(), which > is not recommended. > > $ ldd serverd > serverd: > libmysqlclient_r.so.14 =3D> > /usr/local/lib/mysql/libmysqlclient_r.so.14 (0x28099000) > libssl.so.4 =3D> /usr/lib/libssl.so.4 (0x280ed000) > libpthread.so.2 =3D> /usr/lib/libpthread.so.2 (0x2811b000) > libc.so.6 =3D> /lib/libc.so.6 (0x28140000) > libcrypto.so.4 =3D> /lib/libcrypto.so.4 (0x28217000) > libcrypt.so.3 =3D> /lib/libcrypt.so.3 (0x28309000) > libm.so.4 =3D> /lib/libm.so.4 (0x28321000) > libz.so.3 =3D> /lib/libz.so.3 (0x28337000) > > > This is my system: > FreeBSD Cruel 6.0-STABLE FreeBSD 6.0-STABLE #0: Tue Jan 3 15:40:07 UTC > 2006 root@Cruel:/usr/src/sys/i386/compile/CRUEL i386 > > Any ideas ? > > > Best Regards, > Alexandre Biancalana >