This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: undefined reference to libquadmath routines


On Tue, Jun 7, 2011 at 2:40 PM, Syed Bilal Mehdi
<bilal.mehdi87@gmail.com> wrote:
>
> That solved the problem. But now there is another problem. If I miss adding
> -lfortran as external library, I get the following error during build of my
> test code
>
> [SNIP]
> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/test.cpp:20:
> undefined reference to `quadmath_snprintf'
Then don't do that ;)

> And when I do add ?-lgfortran as external library, the build goes successful
> but I get the following error during runtime
>
> ./test: error while loading shared libraries: libgfortran.so.3: cannot open
> 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 <bilal.mehdi87@gmail.com> writes:
>>
>>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/test.cpp:13:
>>> undefined reference to `sqrtq(__float128)'
>>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/test.cpp:14:
>>> undefined reference to `quadmath_snprintf(char*, unsigned int, char
>>> const*,
>>> ...)'
>>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/test.cpp:18:
>>> undefined reference to `quadmath_snprintf(char*, unsigned int, char
>>> const*,
>>> ...)'
>>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/test.cpp:22:
>>> undefined reference to `quadmath_snprintf(char*, unsigned int, char
>>> const*,
>>> ...)'
>>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/test.cpp:28:
>>> undefined reference to `quadmath_snprintf(char*, unsigned int, char
>>> const*,
>>> ...)'
>>> /site/ae/shares/MotionLab/papers/pingpong/examples/LongDoublePrecisionTests/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. ?There is a missing extern "C"
>> somewhere.
>>
>> In fact, it's in quadmath.h. ?That's a bug. ?Please file a bug report
>> for it. ?Thanks.
>>
>> In the meantime, write this:
>>
>> extern "C" {
>> #include "quadmath.h"
>> }
>>
>> Ian
>>
>>
>
> --
> View this message in context: http://old.nabble.com/undefined-reference-to-libquadmath-routines-tp31790381p31794507.html
> Sent from the gcc - Help mailing list archive at Nabble.com.
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]