wxGnomePrintDC not declared

Hi,

I'm trying to build the latest wxPython 2.8 svn version 54349 on
linux, but got the following error when compiling
src/gtk/_gdi_wrap.cpp

src/gtk/_gdi_wrap.cpp:25351: error: 'wxGnomePrintDC' was not declared
in this scope
src/gtk/_gdi_wrap.cpp:25351: error: 'result' was not declared in this scope
src/gtk/_gdi_wrap.cpp:25370: error: expected primary-expression before ')' token
src/gtk/_gdi_wrap.cpp:25370: error: expected `;' before 'new'
src/gtk/_gdi_wrap.cpp: In function 'PyObject*
_wrap_GnomePrintDC_SetResolution(PyObject*, PyObject*, PyObject*)':
src/gtk/_gdi_wrap.cpp:25399: error: 'wxGnomePrintDC' has not been declared
src/gtk/_gdi_wrap.cpp: In function 'PyObject*
_wrap_GnomePrintDC_GetResolution(PyObject*, PyObject*)':
src/gtk/_gdi_wrap.cpp:25417: error: 'wxGnomePrintDC' was not declared
in this scope
src/gtk/_gdi_wrap.cpp:25417: error: expected `;' before '::' token

There wasn't this problem in an older svn. Please help! Thanks a lot!

--lin

Rob McMullen wrote:

Lin Shao wrote:

I'm trying to build the latest wxPython 2.8 svn version 54349 on
linux, but got the following error when compiling
src/gtk/_gdi_wrap.cpp

src/gtk/_gdi_wrap.cpp:25351: error: 'wxGnomePrintDC' was not declared
in this scope

You need to make sure that your wxGTK is built with libgnomeprint. If the
right dev packages are not installed then it will be disabled automatically.

I'm seeing the same thing.

My configure includes "--with-gnomeprint", but configure puts '#define
wxUSE_LIBGNOMEPRINT 0' in
lib/wx/include/gtk2-unicode-debug-2.8/wx/setup.h because I don't have
libgnomeprintui installed on my system. (I'm running a KDE system.)
configure responds that the library will use standard PostScript
printing.

Having a KDE system doesn't mean that you can't use libgnomeprint. In fact if you need to print from your wx apps you really do want it because it is lots better than the old wx postscript system.

Running 'nm coredll_gprint.o" shows that wxGnomePrintDC isn't in the
symbol table, and it appears to me that _gdi_wrap.cpp assumes that the
wxGnomePrintDC symbol always exists. Perhaps the _gdi_wrap.cpp (or,
really, the SWIG source) needs some #ifdefs around the stuff that
attempts to use the wxGnomePrintDC class?

I agree. I was just trying to say that to build with the current code you need to have the right development libraries installed when compiling wxWidgets.

···

On Tue, Jun 24, 2008 at 10:30 PM, Robin Dunn <robin@alldunn.com> wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Lin Shao wrote:

You need to make sure that your wxGTK is built with libgnomeprint. If the
right dev packages are not installed then it will be disabled automatically.

I do have package libgnomeprintui2.2-0 installed, but not the dev
package. So apparently it's not disabled automatically in building the
Python wrapper? There isn't anything wrong building the wxWidgets
libraries, and I checked
lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h to make sure it has
the line:
#define wxUSE_LIBGNOMEPRINT 0

So like Rob said, this is something specific to _gdi_wrap.cpp and
maybe other _xxx_wrap.cpp's.

Yeah, wxPython makes a lot of assumptions about which of the optional things in wxWidgets are available. I adapt for some things that are impossible to have built-in in some situations, but I pretty much assume that everything else is always there. The reason for this approach is that I prefer to have stub classes for the missing C++ classes that raise exceptions when they are not available, rather than just not having the class at all, and that can lead to quite a bit of extra work to maintain. So I try to keep that to a minimum.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Yeah, wxPython makes a lot of assumptions about which of the optional things
in wxWidgets are available. I adapt for some things that are impossible to
have built-in in some situations, but I pretty much assume that everything
else is always there. The reason for this approach is that I prefer to have
stub classes for the missing C++ classes that raise exceptions when they are
not available, rather than just not having the class at all, and that can
lead to quite a bit of extra work to maintain. So I try to keep that to a
minimum.

I agree. Thanks for the good work.

At any rate, I suppose the --with-gnomeprint/--without-gnomeprint
option can now be removed since it seems like libgnomeprintui is a
hard requirement.

Only for wxPython though. For wxWidgets itself, it is automatically
determined based on whether libgnomeprintui-dev package is installed.
Right now for wxPython to compile, libgnomeprintui-dev has to be
installed and then it works fine.

At any rate, I suppose the --with-gnomeprint/--without-gnomeprint
option can now be removed since it seems like libgnomeprintui is a
hard requirement.

Only for wxPython though. For wxWidgets itself, it is automatically
determined based on whether libgnomeprintui-dev package is installed.

Ah, true. It's the stuff in _gdi_wrap.cpp that's not ifdef'd, which
is only part of wxPython.

Right now for wxPython to compile, libgnomeprintui-dev has to be
installed and then it works fine.

Yep, after installing libgnomeprintui on my gentoo KDE system, 2.8.8.0
compiled with no problems.

Rob

···

On Wed, Jun 25, 2008 at 6:20 PM, Lin Shao <shao@msg.ucsf.edu> wrote: