Compilation of wxWindows / wxGTK

rmunn at pobox.com rmunn at pobox.com
Mon Sep 30 23:20:26 PDT 2002


My bad, left something out:

On Tue, Oct 01, 2002 at 01:08:42AM -0500, rmunn at pobox.com wrote:
> If you ever include wxWindows (http://www.wxwindows.org) or wxGTK (the
> GTK binding of wxWindows) in the BLFS book, here's what I had to do to
> get it to compile.
> 
> I was using wxGTK version 2.2.9, the latest stable-release version as of
> September 26, 2002 (when I downloaded it). I have not tested the most
> current version of wxGTK, version 2.3.3, to discover if it has the same
> issues or not -- but a straightforward "./configure --prefix=/usr ; make
> ; make install" did not work. The compile failed on file
> src/common/fs_zip.cpp with the following error message:
> 
> In file included from ./src/common/fs_zip.cpp:34:
> src/common/unzip.h:121: syntax error before `('
> .
> .
> .
> src/common/unzip.h:262: syntax error before `('
> 
> The vertical ellipses elide about a dozen or so copies of the same
> error, with only line numbers changing. Doing a little research, I found
> the following discussion thread was probably relevant:
> 
> http://psi.sourceforge.net/thread.php?forum=help&tid=33
> 
> What appears to be going on is that src/common/unzip.h (from the wxGTK
> distribution) is #including <zlib.h>, which itself #includes <zconf.h>.
> The CFLAGS and CXXFLAGS wxGTK's main Makefile specify /usr/X11R6/include
> in the include search path, and so that's where gcc was picking up
> zlib.h and zconf.h -- from the include files provided with XFree86
> version 4.2.1. Those include files are for zlib version 1.0.8 (look for
> string ZLIB_VERSION in zlib.h), whereas the zlib include files I had in
> /usr/include were for zlib version 1.1.4 (again, ZLIB_VERSION in
> zlib.h). My gcc version is 2.95.3.
> 
> To solve the problem, what worked for me was the following build
> process:
> 
> CXXFLAGS=/usr/include ./configure --prefix=/usr
> make
> make install

The above really *should* be:

CFLAGS=/usr/include CXXFLAGS=/usr/include ./configure --prefix=/usr
make
make install

The reason for this is that src/common/fs_zip.cpp is compiled with c++
and therefore needs the CXXFLAGS line, but src/common/unzip.c gets
compiled with gcc and therefore needs CFLAGS to be set. But with CFLAGS
*and* CXXFLAGS set like this, compilation really does go without a hitch
(at least on my machine).

> 
> This put /usr/include at the start of the include path and ensured that
> gcc was picking up zlib.h and zconf.h version 1.1.4 from /usr/include
> instead of version 1.0.8 from /usr/X11R6/include.
> 
> I don't know if this advice will be useful to you, but if you do decide
> at some future point to include wxWindows and/or wxGTK in the BLFS book,
> hopefully having this message in the blfs-dev archives will save you
> some headscratching.

-- 
Robin Munn
rmunn at pobox.com
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list