Bug 261423

Summary: math.h missing in kdeedu/kalgebra/analitzagui/graph2d.cpp
Product: [Applications] kalgebra Reporter: Jeremy Lavergne <snc>
Component: generalAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jeremy Lavergne 2010-12-28 03:43:14 UTC
Version:           unspecified (using KDE 4.5.90) 
OS:                OS X

isinf and isnan are undefined on the mac without math.h included

Reproducible: Always

Steps to Reproduce:
attempt to build on the mac

Actual Results:  
build fails, functions are undefined

/opt/local/var/macports/build/_Users_aeetes_kde_kdeedu4/work/kdeedu-4.5.90/kalgebra/analitzagui/graph2d.cpp: In member function 'void Graph2D::drawFunctions(QPaintDevice*)':
/opt/local/var/macports/build/_Users_aeetes_kde_kdeedu4/work/kdeedu-4.5.90/kalgebra/analitzagui/graph2d.cpp:245

Expected Results:  
successful build

Looks like isinf and isnan are defined in math.h:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/isinf.3.html
Comment 1 Jeremy Lavergne 2010-12-28 03:52:15 UTC
Hmm, adding math.h to the .cpp and .h files doesn't seem to have impacted the compilation. It might be more than simply adding the include, or perhaps I've not added it correctly.
Comment 2 Aleix Pol 2010-12-28 13:52:02 UTC
cmath is already included, that's not the problem.

Can you check if std:: is missing?
Comment 3 Jeremy Lavergne 2010-12-28 19:08:31 UTC
Yes, adding std:: allowed compilation. I used the lazy `using namespace std` method.
Comment 4 Aleix Pol 2011-01-03 03:14:07 UTC
SVN commit 1211066 by apol:

Use namespace std:: to compile graph2d. apparently makes it compile in MacOS X.
/me wonders why it works on his system :/...

BUG: 261423


 M  +2 -0      graph2d.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1211066