Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581520 - app-office/texstudio-2.10.6 pdfviewer/PDFDocument.cpp:975:19: error: ‘isnan’ was not declared in this scope
Summary: app-office/texstudio-2.10.6 pdfviewer/PDFDocument.cpp:975:19: error: ‘isnan’ ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Manuel Rüger (RETIRED)
URL:
Whiteboard:
Keywords:
: 581692 583692 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-29 10:20 UTC by Stefan Triller
Modified: 2016-09-25 19:37 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch fixing upsream 1752bug in texstudio (texstudio-2.10.8-bug1752fix.patch,2.13 KB, patch)
2016-05-01 19:32 UTC, Andrzej Kardas
Details | Diff
Updated ebuild that compiles on my system (texstudio-2.11.0.ebuild,2.16 KB, text/plain)
2016-06-05 18:49 UTC, Andreas G.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Triller 2016-04-29 10:20:24 UTC
Hello,

somehow texstudio does not want to compile on my machine due to this error:

pdfviewer/PDFDocument.cpp: In member function ‘void PDFWidget::goToPageRelativePosition(int, float, float)’:
pdfviewer/PDFDocument.cpp:968:18: error: ‘isnan’ was not declared in this scope
  if (isnan(xinpdf)) xinpdf = 0;
                  ^
pdfviewer/PDFDocument.cpp:968:18: note: suggested alternative:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/random:38:0,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/bits/stl_algo.h:66,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:85,
                 from /usr/include/qt5/QtCore/qnamespace.h:37,
                 from /usr/include/qt5/QtCore/qobjectdefs.h:41,
                 from /usr/include/qt5/QtCore/qobject.h:40,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from ./modifiedQObject.h:44,
                 from ./mostQtHeaders.h:12,
                 from pdfviewer/PDFDocument.h:28,
                 from pdfviewer/PDFDocument.cpp:24:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
pdfviewer/PDFDocument.cpp:970:18: error: ‘isnan’ was not declared in this scope
  if (isnan(yinpdf)) yinpdf = 0;
                  ^
pdfviewer/PDFDocument.cpp:970:18: note: suggested alternative:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/random:38:0,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/bits/stl_algo.h:66,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:85,
                 from /usr/include/qt5/QtCore/qnamespace.h:37,
                 from /usr/include/qt5/QtCore/qobjectdefs.h:41,
                 from /usr/include/qt5/QtCore/qobject.h:40,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from ./modifiedQObject.h:44,
                 from ./mostQtHeaders.h:12,
                 from pdfviewer/PDFDocument.h:28,
                 from pdfviewer/PDFDocument.cpp:24:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
pdfviewer/PDFDocument.cpp:975:19: error: ‘isnan’ was not declared in this scope
  if (!isnan(xinpdf))


I also tried it with gcc 4.9.3 and i also added CXXFLAGS="${CXXFLAGS} -std=gnu++11" in my /etc/portage/env/app-office/texstudio-2.10.8

since I read that isnan might be related to that, but it still doesn't work.

Am I missing something or is there a patch necessary? Because I found this:
http://stackoverflow.com/questions/18128899/is-isnan-in-the-std-namespace-more-in-general-when-is-std-necessary-optio

My system ist ~amd64.

Regards,

Stefan
Comment 1 Alexandre 2016-05-01 05:09:40 UTC
*** Bug 581692 has been marked as a duplicate of this bug. ***
Comment 2 Alexandre 2016-05-01 05:11:56 UTC
It seems related with the last poppler bump (0.43.0).
Comment 3 Franz Trischberger 2016-05-01 05:34:40 UTC
I just created an upstream ticket:
https://sourceforge.net/p/texstudio/bugs/1752/
Comment 4 Stefan Triller 2016-05-01 08:44:14 UTC
Are you sure its related to poppler 0.43?

Because I am still on poppler 0.42 and the update to 0.43 is pending, i.e. I could install it now, but if it causes even more trouble, I won't do it now.
Comment 5 Alexandre 2016-05-01 16:34:15 UTC
No. I guessed about poppler because I had compiled texstudio these days and everything went fine until the new version of poppler be updated, what forced the rebuild of texstudio and its failed.
Comment 6 Alexandre 2016-05-01 16:40:45 UTC
I do not code but I took a look on similar situations on several applications with the same error at compile phase, and the fix was:

replace isnan() with std::isnan()

If someone could crate a patch I will be glad to test it.
Comment 7 Andrzej Kardas 2016-05-01 18:38:47 UTC
(In reply to Franz Fellner from comment #3)
> I just created an upstream ticket:
> https://sourceforge.net/p/texstudio/bugs/1752/

Upstream fixed it:
https://sourceforge.net/p/texstudio/hg/ci/91a3b80d1379dad093b489ca34e64bc17d6e632b/
Comment 8 Andrzej Kardas 2016-05-01 19:32:51 UTC
Created attachment 432866 [details, diff]
Patch fixing upsream 1752bug in texstudio

Patch from commit fixing bug1752 in texstudio - with this patch applied the texstudio is building on my machines, HTH.
Comment 9 Franz Trischberger 2016-05-01 20:03:15 UTC
Please note that there were several other commits to patch out <cmath> again and replace it by Qt-internal function qIsNaN (which initially broke qt4-builds but that also got fixed). This is due to support for older compilers that don't support C++11. But as it seems the OpenSuse Build-Farm did not complain even on systems having too old compilers...
So this patch might be OK for Gentoo, but it has the potential to break things on another end ;)
Comment 10 Manuel Rüger (RETIRED) gentoo-dev 2016-05-22 17:10:32 UTC
*** Bug 583692 has been marked as a duplicate of this bug. ***
Comment 11 tman 2016-05-23 16:36:39 UTC
so what the solution?
Comment 12 Andreas G. 2016-06-03 20:14:56 UTC
(In reply to tman from comment #11)
2.11.0 is out, compiled fine with a minimally modified ebuild based on texstudio-2.10.8. (texstudio-2.6.4-hunspell-quazip.patch no longer needed/fails)
Comment 13 tman 2016-06-04 02:13:08 UTC
(In reply to Andreas G. from comment #12)
> (In reply to tman from comment #11)
> 2.11.0 is out, compiled fine with a minimally modified ebuild based on
> texstudio-2.10.8. (texstudio-2.6.4-hunspell-quazip.patch no longer
> needed/fails)

would you like to upload this modified ebuild please?
Comment 14 Andreas G. 2016-06-05 18:49:57 UTC
Created attachment 436576 [details]
Updated ebuild that compiles on my system
Comment 15 Manuel Rüger (RETIRED) gentoo-dev 2016-08-25 15:45:48 UTC
commit 5ab76a7c58637868046230813fbc28571441afa3
Author: Manuel Rüger <mrueg@gentoo.org>
Date:   Thu Aug 25 17:43:36 2016 +0200

    app-office/texstudio: Version bump to 2.11.0
    
    Gentoo-Bug: #581520
    Gentoo-Bug: #586854
    Gentoo-Bug: #584888
    Gentoo-Bug: #590702
    
    Package-Manager: portage-2.3.0

Bumped to 2.11.0, please test if the error still occurs.
Comment 16 Andreas G. 2016-09-25 19:33:15 UTC
Appears to be fixed!