From owner-freebsd-questions@FreeBSD.ORG Wed Apr 19 14:44:56 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 1455D16A409 for ; Wed, 19 Apr 2006 14:44:56 +0000 (UTC) (envelope-from biancalana@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AFC543D48 for ; Wed, 19 Apr 2006 14:44:55 +0000 (GMT) (envelope-from biancalana@gmail.com) Received: by xproxy.gmail.com with SMTP id s9so715478wxc for ; Wed, 19 Apr 2006 07:44:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=TRQgonquiVarKl1QgT39mizHHHMq34Mb/buZ5n0rmbVpYxSxR25lD4kVvCacnCwB+cBT2VkWK2gUFqgOFSqim6kpppe2soXTB4LOAenBFj1tDuqn1mR3OvLucSEPxKRg/DuhApnIwVgxmRDKFLWJmRgyTI+Ky+a0Ht+Qq+CQYXA= Received: by 10.70.125.3 with SMTP id x3mr7843wxc; Wed, 19 Apr 2006 07:44:54 -0700 (PDT) Received: by 10.70.123.7 with HTTP; Wed, 19 Apr 2006 07:44:54 -0700 (PDT) Message-ID: <8e10486b0604190744q124cf7c7j54524d2e4f0368d8@mail.gmail.com> Date: Wed, 19 Apr 2006 11:44:54 -0300 From: "Alexandre Biancalana" To: freebsd-questions@freebsd.org MIME-Version: 1.0 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: 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, 19 Apr 2006 14:44:56 -0000 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 gprof 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.o threads_control.o -pthread -lmysqlclient_r -lssl /usr/lib/libc.so: warning: warning: this program uses f_prealloc(), which i= s 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