Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9582 closed Bug report (fixed)

FileZilla "hardcodes" inclusion of GTK2 even when wxWidgets use GTK3

Reported by: Mojca Miklavec Owned by:
Priority: normal Component: FileZilla Client
Keywords: Cc:
Component version: Operating system type:
Operating system version:

Description

I have wxGTK 3.0.1 installed (I'm using OS X 10.7, but I'm almost sure that this isn't OSX-specific and could be reproduced on Linux; I didn't try though).

$ wx-config --cxxflags
-I/path/to/wxGTK/3.0/lib/wx/include/gtk3-unicode-3.0 -I/path/to/wxGTK/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__

$ wx-config --libs
-L/path/to/wxGTK/3.0/lib -framework IOKit -framework CoreServices -framework System -framework ApplicationServices -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_webview-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

The problem is that FileZilla's configure hardcodes inclusion of GTK 2 headers:

  if echo "$WX_CPPFLAGS" | grep __WXGTK__ > /dev/null 2>&1; then

    AC_PATH_PROG(xdgopen, xdg-open)
    if test -z "$xdgopen"; then
      AC_MSG_ERROR([xdg-open not found. This program is the preferred way to launch the default browser. Please install the xdg-utils.])
    fi

    PKG_CHECK_MODULES(LIBGTK, gtk+-2.0,, [
      AC_MSG_ERROR([gtk+-2.0 was not found, even though the used version of wxWidgets depends on it. Are you missing the gtk+2.0 development files?])
    ])

    AC_SUBST(LIBGTK_LIBS)
    AC_SUBST(LIBGTK_CFLAGS)
  fi

and this fails to work:

/usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../src/include  -I./../include -I/path/to/wxGTK/3.0/lib/wx/include/gtk3-unicode-3.0 -I/path/to/wxGTK/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -I/opt/local/include  -D_REENTRANT -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/pango-1.0 -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16  -I/opt/local/include -fpch-preprocess -I/path/to/wxGTK/3.0/lib/wx/include/gtk3-unicode-3.0 -I/path/to/wxGTK/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pipe -Os -arch x86_64 -stdlib=libstdc++ -Wall -g -fexceptions -std=gnu++11 -MT filezilla-filelist_statusbar.o -MD -MP -MF .deps/filezilla-filelist_statusbar.Tpo -c -o filezilla-filelist_statusbar.o `test -f 'filelist_statusbar.cpp' || echo './'`filelist_statusbar.cpp
In file included from filelistctrl.cpp:12:
In file included from /opt/local/include/gtk-2.0/gtk/gtk.h:32:
In file included from /opt/local/include/gtk-2.0/gdk/gdk.h:32:
In file included from /opt/local/include/gtk-2.0/gdk/gdkapplaunchcontext.h:31:
In file included from /opt/local/include/gtk-2.0/gdk/gdkscreen.h:32:
/opt/local/include/gtk-2.0/gdk/gdktypes.h:114:39: error: typedef redefinition with different types ('struct _GdkDrawable' vs 'struct _GdkWindow')
typedef struct _GdkDrawable           GdkWindow;
                                      ^
/path/to/wxGTK/3.0/include/wx-3.0/wx/defs.h:3412:31: note: previous definition is here
    typedef struct _GdkWindow GdkWindow;
                              ^
1 error generated.
make[4]: *** [filezilla-filelistctrl.o] Error 1
make[4]: *** Waiting for unfinished jobs....

This isn't a showstopper on Mac where users can (and should) use the native Cocoa user interface (but one shouldn't assume that GTK always means Linux though). We provide wxGTK 2.8 as a fallback for programs that require wxWidgets 2.8. In this case I wanted to provide a wxGTK 3.0 fallback because some functionality in the Cocoa inteface isn't working properly yet on Mac.

But I'm afraid that this would be a problem on other OSes as well.

Change History (3)

comment:1 by Mojca Miklavec, 10 years ago

The proper way to check for this would probably be to use the output of wx-config instead of echo "$WX_CPPFLAGS" | grep __WXGTK__:

$ wx-config --basename
wx_gtk2u

$ wx-config --basename
wx_gtk3u

$ wx-config --basename
wx_osx_cocoau

There is also a variable WX_PORT listed in wxwin.m4, but it doesn't list gtk3 and I don't know how to use it.

comment:2 by Tim Kosse, 10 years ago

Resolution: fixed
Status: newclosed

Support for the GTK+3 configuration of wxWidgets has been improved.

comment:3 by Mojca Miklavec, 10 years ago

Thank you. There is probably a small typo (once it's 3 and once it's 2):

gtk+-3.0 was not found, even though the used version of wxWidgets depends on it.
Are you missing the gtk+2.0 development files?
Note: See TracTickets for help on using tickets.