From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2570 invoked by alias); 7 Jun 2011 19:40:06 -0000 Received: (qmail 2559 invoked by uid 22791); 7 Jun 2011 19:40:04 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_IB,TW_LG X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jun 2011 19:39:49 +0000 Received: by wwf26 with SMTP id 26so4884991wwf.8 for ; Tue, 07 Jun 2011 12:39:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.229.82 with SMTP id g60mr4117054weq.70.1307475588336; Tue, 07 Jun 2011 12:39:48 -0700 (PDT) Received: by 10.216.89.213 with HTTP; Tue, 7 Jun 2011 12:39:48 -0700 (PDT) Reply-To: noloader@gmail.com In-Reply-To: <31794507.post@talk.nabble.com> References: <31790381.post@talk.nabble.com> <31794507.post@talk.nabble.com> Date: Tue, 07 Jun 2011 19:58:00 -0000 Message-ID: Subject: Re: undefined reference to libquadmath routines From: Jeffrey Walton To: Syed Bilal Mehdi Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00177.txt.bz2 On Tue, Jun 7, 2011 at 2:40 PM, Syed Bilal Mehdi wrote: > > That solved the problem. But now there is another problem. If I miss addi= ng > -lfortran as external library, I get the following error during build of = my > test code > > [SNIP] > /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTes= ts/test.cpp:20: > undefined reference to `quadmath_snprintf' Then don't do that ;) > And when I do add =A0-lgfortran as external library, the build goes succe= ssful > but I get the following error during runtime > > ./test: error while loading shared libraries: libgfortran.so.3: cannot op= en > shared object file: No such file or directory > > Is it a bug again? or am I missing something this time? and why is fortran > important here? Is libgfortran.so installed and available? `whereis libgfortran.so` or `file libgfortran.so` should let you know if its installed. `ldconfig -p | grep -i libgfortran` should tell you if its available. Jeff > > Ian Lance Taylor-3 wrote: >> >> Syed Bilal Mehdi writes: >> >>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionT= ests/test.cpp:13: >>> undefined reference to `sqrtq(__float128)' >>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionT= ests/test.cpp:14: >>> undefined reference to `quadmath_snprintf(char*, unsigned int, char >>> const*, >>> ...)' >>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionT= ests/test.cpp:18: >>> undefined reference to `quadmath_snprintf(char*, unsigned int, char >>> const*, >>> ...)' >>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionT= ests/test.cpp:22: >>> undefined reference to `quadmath_snprintf(char*, unsigned int, char >>> const*, >>> ...)' >>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionT= ests/test.cpp:28: >>> undefined reference to `quadmath_snprintf(char*, unsigned int, char >>> const*, >>> ...)' >>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionT= ests/test.cpp:18: >>> undefined reference to `quadmath_snprintf(char*, unsigned int, char >>> const*, >>> ...)' >>> >>> What am I missing here. I tried specifying -lquadmath but that didn't >>> help!! >> >> The format of those errors tells me that you are calling these as C++ >> functions, but they are written in C. =A0There is a missing extern "C" >> somewhere. >> >> In fact, it's in quadmath.h. =A0That's a bug. =A0Please file a bug report >> for it. =A0Thanks. >> >> In the meantime, write this: >> >> extern "C" { >> #include "quadmath.h" >> } >> >> Ian >> >> > > -- > View this message in context: http://old.nabble.com/undefined-reference-t= o-libquadmath-routines-tp31790381p31794507.html > Sent from the gcc - Help mailing list archive at Nabble.com. > >