Project

General

Profile

Actions

Emulator Issues #7069

closed

Building 4.0.2 with wx 3.0

Added by alexjnewt almost 11 years ago. Updated over 8 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Hi I've been trying to build dolphin 4.0.2 on Fedora with a shared wx 3.0 library.

I used -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-3.0, but it doesn't seem to build with the shared anyway.

Is this because dolphin used 2.9 not 3.0?
Is there a patch or a revision/commit I can use to compile dolphin using this shared library? If not, I think it would be wise to update the bundled version of wx to 3.0, as it is the latest stable release, and 2.9 was a development version.

I patched the cmake file to assume that the correct wx version is installed, but it appears to have a build fail around 70-80%. I can post this when I get home, if valuable.

Actions #1

Updated by webgeek1234 almost 11 years ago

I ran into this myself today trying to build trunk. I tinkered with it a bit further and found the incompatibility. The wxGTK3 package in Fedora testing is built against gtk 3, while dolphin looks specifically for gtk 2 and includes it for its X11Utils stuff. I was able to make it compile, but the executable asserts out when it detects both gtk 2 and 3 symbols in the same executable.

To the devs: Fedora wants to keep compatibility with all wx 2.8 packages, so the wx-config script is still set up for 2.8. wx-config-3.0 is the wx 3.0 version. wx-config --version=3.0 will also return the correct info. As for the gtk 2 vs. 3 incompatibility, I don't know what to do there. If the code is 3 compatible, maybe have cmake check for 3 first and fall back to 2 if 3 isn't found.

Actions #2

Updated by alexjnewt almost 11 years ago

Hmm i see so if I understand properly, is this due to cmake linking to gtk 2 specifically for the X11Utils part of dolphin and not checking for gtk 3? Are you able to direct me to where this section of the code is located so I can play with and develop a patch for cmake?

Actions #3

Updated by webgeek1234 almost 11 years ago

Yes, that is what it seems to me. I know very little of cmake and even less of how to do it right. The GTK checks are in the CMakeLists.txt, grep or search that for GTK. Hopefully one of the Linux devs will be along soon with a more knowledgeable answer.

Actions #4

Updated by alexjnewt almost 11 years ago

Hmm, I'll take a look into the CMakelists.txt files tonight or this weekend when I have some time. Perhaps I can get a tentative patch for the Fedora package until they fix this.

Actions #5

Updated by alexjnewt almost 11 years ago

Yep, it seems that the code is compatible with gtk3 and just needs a modification to the cmake files to build and run.

I have noticed though that theres a some odd glitching, although I don't know if this is caused by a glitch in the wx 3.0 fedora package or the way I patched dolphin; I'll look further into this.

See attached patch and screenshot

Actions #6

Updated by webgeek1234 almost 11 years ago

Wow, okay. I got a similar patch to work. It's the first part that's actually doing to the work (under your cmake ver == 2.8.12). I don't know how to correctly Find_GTK3 or whatever, that part doesn't work.

And yeah, my styles are broken too. But in a completely different way. I expect that to be due to local GTK3 settings. Since I use KDE (Qt based), I probably don't even have the styles properly set up. That should be fixable user side and not something the project has to worry about.

However, I am getting errors like:
(dolphin-emu:26420): Gtk-CRITICAL **: gtk_device_grab_remove: assertion 'GDK_IS_DEVICE (device)' failed
Differing assertions of failed type conversions. Don't know if that's a wxGTK3 problem or if there's manual tinkering in this project. Sometimes it crashes after these, sometimes not. I haven't messed with it enough to narrow down a cause. None of this is terribly important since the fallback external still works and Fedora is afaik the only distro shipping (well, testing) wx-3.0 compiled against GTK3. So, unless a dev asks for more info (which I'm more than willing to give), I'm going to continue using the externals copy.

Actions #7

Updated by delroth almost 11 years ago

  • Status changed from New to Accepted

I don't have a system where wx 3.0 is built using GTK 3.0 - on a recently updated Arch, cmake picks up the system version of wx fine.

If someone managed to find a fix, please provide a pull request on https://github.com/dolphin-emu/dolphin :)

Actions #9

Updated by alexjnewt over 10 years ago

Oh this isn't necessarily the same bug. I can build dolphin just fine, but I haven't tested with the lastest gcc

Actions #10

Updated by sheepdestroyer over 10 years ago

could you share your modifications to permit the build with shared wxWidget?

Actions #11

Updated by sheepdestroyer about 10 years ago

today on my fedora system, I did the modifications to both cmake files as reported by alexjn and installed his new wxgtk3 rpms from rawhide as he mentionned on the redhat bugzilla.

With cmake -DwxWidgets_CONFIG_EXECUTABLE=/usr/libexec/wxGTK3/wx-config, cmake now finds my shared wx and make tries to compile without static wx.

However it fails with :
/home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/X11Utils.h:16:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>

on my system I Have :
/usr/include/gtk-1.2/gtk/gtk.h
/usr/include/gtk-2.0/gtk/gtk.h
/usr/include/gtk-3.0/gtk/gtk.h

any idea?

Actions #12

Updated by alexjnewt about 10 years ago

To make GTK3 work with Dolphin, I made this work with the following adjustment in the CMakeLists file:

check_lib(GTK3 gtk+-3.0 gtk.h REQUIRED)
include_directories(${GTK3_INCLUDE_DIRS})

To detect and include GTK3, instead of using include(FindGTK2), etc.

And I replaced ${GTK2_LIBRARIES} with ${GTK3_LIBRARIES} in Source/Core/DolphinWX/CMakeLists.txt

I'm not sure how you would implement this without breaking gtk2. I'm sure theres a flag or check that could be used to see if WX is build on GTK3 or GTK2.

@sheepdes
I can send you my RPMFusion SRPM if you're still figuring this out. It shouldn't depend on RPMFusion if you have something against the repo.

Actions #13

Updated by sheepdestroyer over 9 years ago

build still fail on fedora 22 with wxGTK3-devel:
build after "cmake -DwxWidgets_CONFIG_EXECUTABLE=/usr/libexec/wxGTK3/wx-config" still fails with gtk2 errors :
Linking CXX static library libcore.a
[ 89%] Built target core
Scanning dependencies of target dolphin-emu-nogui
Scanning dependencies of target dolphin-emu
[ 89%] [ 90%] Building CXX object Source/Core/DolphinWX/CMakeFiles/dolphin-emu-nogui.dir/MainNoGUI.cpp.o
Building CXX object Source/Core/DolphinWX/CMakeFiles/dolphin-emu-nogui.dir/X11Utils.cpp.o
In file included from /usr/include/wx-3.0/wx/arrstr.h:14:0,
from /home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/X11Utils.h:18,
from /home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/MainNoGUI.cpp:116:
/usr/include/wx-3.0/wx/defs.h:3412:31: error: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
typedef struct _GdkWindow GdkWindow;
^
In file included from /usr/include/gtk-2.0/gdk/gdkscreen.h:32:0,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:31,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from /home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/X11Utils.h:16,
from /home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/MainNoGUI.cpp:116:
/usr/include/gtk-2.0/gdk/gdktypes.h:114:39: note: previous declaration as ‘typedef struct _GdkDrawable GdkWindow’
typedef struct _GdkDrawable GdkWindow;
^
[ 90%] [ 90%] Building CXX object Source/Core/DolphinWX/CMakeFiles/dolphin-emu.dir/ARCodeAddEdit.cpp.o
Building CXX object Source/Core/DolphinWX/CMakeFiles/dolphin-emu.dir/AboutDolphin.cpp.o
In file included from /usr/include/wx-3.0/wx/arrstr.h:14:0,
from /home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/X11Utils.h:18,
from /home/sheepdestroyer/Downloads/dolphin-master/Source/Core/DolphinWX/X11Utils.cpp:12:
/usr/include/wx-3.0/wx/defs.h:3412:31: error: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
typedef struct _GdkWindow GdkWindow;

Actions #14

Updated by JMC4789 over 8 years ago

  • Status changed from Accepted to Invalid

Dolphin 5.0 has been released, and 4.0.2 is no longer under active support.

Actions

Also available in: Atom PDF