On Sun, 29 May 2005, Bob Jamison wrote:
Bryce Harrington wrote:
On Sun, May 29, 2005 at 05:10:09PM +0200, Franz Haeuslschmid wrote:
[... object-edit.cpp:846: error: `isfinite' undeclared in namespace `std' ...]
Hmm, it sort of sounds like you need the Standard C++ Template Library installed. isfinite is one of its functions. Not sure exactly what you have to do to get that installed under Cygnus, but I'm sure someone's documented it.
FYI, if you look at the code, line 846 of object-edit.cpp refers to 'isFinite', which is defined in isnan.h for WIN32 to be std::isfinite.
For cygwin, the linux definitions of `isnan' and `isfinite' should be chosen. Actually, `isfinite' is defined in the `math.h' of cygwin (without definition of a namespace).
[...]
Actually, this is probably defined under gcc/cygwin, and you might check to find out what Cygwin's flavor is. If you get it to work, please let us know, and we will add another switch for #ifdef CYGWIN.
I played around with imports and functions and created a little test file that uses dirctly `isfinite':
#include <stdio.h> #include <math.h>
int main() { float f = 12.34; printf("f = %d", isfinite(f)); }
I placed this file in inkscape's source directory and compiled it with `g++' using all the parameters that were also used for `object-edit.cpp' (newlines were inserted for clearness):
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/include/freetype2 -I/opt/cxclient/usr/X11R6/include -DPOTRACE="potrace" -DXTHREADS -DXUSE_MTSAFE_API -I/home/haeuslsc/local/include/gdkmm-2.4 -I/home/haeuslsc/local/lib/gdkmm-2.4/include -I/home/haeuslsc/local/include/glibmm-2.4 -I/home/haeuslsc/local/lib/glibmm-2.4/include -I/home/haeuslsc/local/include/pangomm-1.4 -I/home/haeuslsc/local/include/gtk-2.0 -I/home/haeuslsc/local/lib/gtk-2.0/include -I/usr/X11R6/include -I/home/haeuslsc/local/include/sigc++-2.0 -I/home/haeuslsc/local/lib/sigc++-2.0/include -I/home/haeuslsc/local/include/glib-2.0 -I/home/haeuslsc/local/lib/glib-2.0/include -I/home/haeuslsc/local/include/pango-1.0 -I/usr/include/freetype2 -I/opt/cxclient/usr/X11R6/include -I/home/haeuslsc/local/include/gtkmm-2.4 -I/home/haeuslsc/local/lib/gtkmm-2.4/include -I/home/haeuslsc/local/include/atkmm-1.6 -I/home/haeuslsc/local/include/atk-1.0 -I/usr/include/libxml2 -I../cxxtest -Wall -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -Wno-unused-parameter -g -O2 -MT test.o -MD -MP -MF "$depbase.Tpo" -c -o test.o test.cpp
That worked. However, when I throw in additional includes like `#include "sp-item.h"' or `#include "sp-item.h"', compilation fails again:
test.cpp: In function `int main()': test.cpp:26: error: `isfinite' undeclared (first use this function) test.cpp:26: error: (Each undeclared identifier is reported only once for each function it appears in.)
There are several more include directives taken from `object-edit.cpp' that trigger these compile errors. As far as I checked the header files, only `isnan.h' uses `isfinite'. I cannot imagine, how the inclusion of header files can change the visibility of a certain function. Did I miss something else?
Franz.