Bug 99716 - Compile error on Solaris 2.9 in gvscrollpixmapview.cpp
Summary: Compile error on Solaris 2.9 in gvscrollpixmapview.cpp
Status: RESOLVED WORKSFORME
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-18 16:51 UTC by Bernd Kuhls
Modified: 2012-10-19 13:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Kuhls 2005-02-18 16:51:04 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3.5 
OS:                Solaris

Compiling produces this error, this bug is similar to bug 99346

if /bin/bash ../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../..  -I./.. -I/usr/local/KDE-3.4.0_CVS/include -I/usr/local/qt-050201/include   -D_LARGEFILE64_SOURCE -DQT_THREAD_SUPPORT  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT gvscrollpixmapview.lo -MD -MP -MF ".deps/gvscrollpixmapview.Tpo" \
  -c -o gvscrollpixmapview.lo `test -f 'gvscrollpixmapview.cpp' || echo './'`gvscrollpixmapview.cpp; \
then mv -f ".deps/gvscrollpixmapview.Tpo" ".deps/gvscrollpixmapview.Plo"; \
else rm -f ".deps/gvscrollpixmapview.Tpo"; exit 1; \
fi
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::imageToWidgetX(int) const':
gvscrollpixmapview.cpp:227: error: `round' undeclared (first use this function)
gvscrollpixmapview.cpp:227: error: (Each undeclared identifier is reported only
   once for each function it appears in.)
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::imageToWidgetY(int) const':
gvscrollpixmapview.cpp:232: error: `round' undeclared (first use this function)
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::widgetToImageX(int) const':
gvscrollpixmapview.cpp:247: error: `round' undeclared (first use this function)
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::widgetToImageY(int) const':
gvscrollpixmapview.cpp:252: error: `round' undeclared (first use this function)
make: *** [gvscrollpixmapview.lo] Error 1
Comment 1 Lubos Lunak 2005-02-21 12:28:00 UTC
CVS commit by lunakl: 

math.h for round()
BUG: 99716


  M +1 -0      gvscrollpixmapview.cpp   1.135


--- kdeextragear-1/gwenview/src/gvscrollpixmapview.cpp  #1.134:1.135
@@ -21,4 +21,5 @@ Foundation, Inc., 59 Temple Place - Suit
 
 #include <assert.h>
+#include <math.h>
 
 // Qt 


Comment 2 Bernd Kuhls 2005-02-21 15:56:06 UTC
Your patch does not solve the problem here because round() is not defined in math.h on Solaris:

if /bin/bash ../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../..  -I./.. -I/usr/local/KDE-3.4.0_CVS/include -I/usr/local/qt-050201/include   -D_LARGEFILE64_SOURCE -DQT_THREAD_SUPPORT  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION-MT gvscrollpixmapview.lo -MD -MP -MF ".deps/gvscrollpixmapview.Tpo" \
  -c -o gvscrollpixmapview.lo `test -f 'gvscrollpixmapview.cpp' || echo './'`gvscrollpixmapview.cpp; \
then mv -f ".deps/gvscrollpixmapview.Tpo" ".deps/gvscrollpixmapview.Plo"; \
else rm -f ".deps/gvscrollpixmapview.Tpo"; exit 1; \
fi
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::imageToWidgetX(int) const':
gvscrollpixmapview.cpp:228: error: `round' undeclared (first use this function)
gvscrollpixmapview.cpp:228: error: (Each undeclared identifier is reported only
   once for each function it appears in.)
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::imageToWidgetY(int) const':
gvscrollpixmapview.cpp:233: error: `round' undeclared (first use this function)
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::widgetToImageX(int) const':
gvscrollpixmapview.cpp:248: error: `round' undeclared (first use this function)
gvscrollpixmapview.cpp: In member function `int
   GVScrollPixmapView::Private::widgetToImageY(int) const':
gvscrollpixmapview.cpp:253: error: `round' undeclared (first use this function)
make[3]: *** [gvscrollpixmapview.lo] Error 1
Comment 3 Angelo Naselli 2005-02-21 16:24:12 UTC
Probably you have to use floor()
and maybe to know if you are compiling under linux
use the __linux__ macro but i don't know if it is
only for gcc. 

~ [56]> man floor
NAME
     floor - floor function

SYNOPSIS
     cc [ flag ... ] file ... -lm [ library ... ]
     #include <math.h>

     double floor(double x);

DESCRIPTION
     The floor() function computes the largest integral value not
     greater than x.

RETURN VALUES
     Upon successful  completion,  floor()  returns  the  largest
     integral value not greater than x, expressed as a double.

     If x is NaN, NaN is returned.
ERRORS
     No errors will occur.

USAGE
     The integral value returned by floor() as a double might not
     be  expressible  as  an  int  or  long int. The return value
     should be tested before assigning it to an integer  type  to
     avoid the undefined results of an integer overflow.

ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | MT-Level                    | MT-Safe                     |
    |_____________________________|_____________________________|



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Comment 4 Aurelien Gateau 2005-02-21 23:16:51 UTC
Seems like Adrian De Groot fixed this bug. Can you check if the current CVS works for you?

If you can't use the CVS version, can you try to replace the round() call with rint() and tell us if it fixes the problem?
Comment 5 Bernd Kuhls 2005-02-22 14:52:20 UTC
Yep, original snapshot 050222 compiles now, thanks!