[Scribus] NULL undeclared in scpreview.cpp and mpalette.cpp
Jeremy C. Reed
reed
Thu Oct 16 09:36:36 CEST 2003
Building scribus-1.0.1 and scribus-1.1.1 fail with:
scpreview.cpp: In method `class QPixmap ScPreview::createPreview(QString)':
scpreview.cpp:323: `NULL' undeclared (first use this function)
And later ...
mpalette.cpp: In method `void Mpalette::SetSTline(QListBoxItem *)':
mpalette.cpp:2252: `NULL' undeclared (first use this function)
I used "cpp -dD" to track down how NULL was defined.
It appeared to be defined in both cases as:
__null
But __null was not defined.
My first workaround was to patch scribus/scpreview.cpp and
scribus/mpalette.cpp like:
+#ifndef NULL
+#define NULL 0
+#endif
This worked fine. But why wasn't the _null understood.
My second workaround instead of defining NULL in scpreview.cpp and
mpalette.cpp was to add:
#include <iostream>
I am not sure what the correct fix is.
This may be specific to my build environment -- which is pkgsrc under
NetBSD/i386 1.6.1_STABLE using g++ 2.95.3. (I also had same problem with
scribus-1.0.1 in the Spring. I think I had same problem under Linux with
gcc 3.x.x but still using pkgsrc as the build environment.)
Jeremy C. Reed
http://www.bsdnewsletter.com/
p.s. By the way, the build part was:
source='scpreview.cpp' object='scpreview.o' libtool=no \
depfile='.deps/scpreview.Po' tmpdepfile='.deps/scpreview.TPo' \
depmode=gcc /bin/sh ../admin/depcomp \
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/pkg/include/libart-2.0
-I/usr/pkg/include/freetype2 -I/usr/pkg/include -I/usr/pkg/qt3/include
-I/usr/X11R6/include -DQT_THREAD_SUPPORT -DGLX_GLXEXT_LEGACY
-I/usr/pkg/include -I/usr/X11R6/include -O2 -O2 -DGLX_GLXEXT_LEGACY
-I/usr/pkg/include -I/usr/X11R6/include -fno-exceptions -fno-check-new -c
-o scpreview.o `test -f 'scpreview.cpp' || echo './'`scpreview.cpp
But is uses some wrappers to do the real build which become:
/usr/bin/c++ -DHAVE_CONFIG_H -I. -I. -I..
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink/include/libart-2.0
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink/include/freetype2
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink/include
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink/qt3/include
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink-x11/include
-DQT_THREAD_SUPPORT -DGLX_GLXEXT_LEGACY
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink/include
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink-x11/include
-O2 -O2 -DGLX_GLXEXT_LEGACY
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink/include
-I/usr/pkg/tmp/pkgsrc/print/scribus/work.rainier/.buildlink-x11/include
-fno-exceptions -fno-check-new -c -o scpreview.o scpreview.cpp
-Wp,-MD,.deps/scpreview.TPo
More information about the scribus
mailing list