4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.53k stars 842 forks source link

Build fails on archlinux64 #1

Closed fdev31 closed 10 years ago

fdev31 commented 10 years ago

Using gtk-3.12.2 and wxgtk-3.0.0, I get the following traceback while building on some Archlinux system:

In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30:0,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from /tmp/gd/src/GD-build/Core/GDCore/IDE/Dialogs/ResourcesEditor.cpp:55:
/usr/include/gtk-3.0/gdk/gdktypes.h:127:39: erreur: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
 typedef struct _GdkWindow             GdkWindow;
                                       ^
In file included from /usr/include/wx-3.0/wx/treectrl.h:18:0,
                 from /tmp/gd/src/GD-build/Core/./GDCore/IDE/Dialogs/ResourcesEditor.h:10,
                 from /tmp/gd/src/GD-build/Core/GDCore/IDE/Dialogs/ResourcesEditor.cpp:8:
/usr/include/wx-3.0/wx/defs.h:3396:33: note: previous declaration as ‘typedef struct _GdkDrawable GdkWindow’
     typedef struct _GdkDrawable GdkWindow;
                                 ^
Core/CMakeFiles/GDCore.dir/build.make:1522: recipe for target 'Core/CMakeFiles/GDCore.dir/GDCore/IDE/Dialogs/ResourcesEditor.cpp.o' failed
make[2]: *** [Core/CMakeFiles/GDCore.dir/GDCore/IDE/Dialogs/ResourcesEditor.cpp.o] Error 1
CMakeFiles/Makefile2:78: recipe for target 'Core/CMakeFiles/GDCore.dir/all' failed
make[1]: *** [Core/CMakeFiles/GDCore.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

Is it some familiar definition conflict to you ? What are the supported gtk/wx versions ? I'm really not sure it's a bug, or eventually in the cmake files...

4ian commented 10 years ago

I never had this error, maybe the problem is in wxgtk-3.0.0. I've found this thread where the issue seems similar: http://forums.wxwidgets.org/viewtopic.php?t=37593&p=153082

Be sure to to a "make clean", then try to do a "./configure --with-gtk=2", then "make" and "make install" to force the use of GTK+2 instead of GTK+3... But it's quite strange, I've successfully built GD on Ubuntu with GTK+3.

victorlevasseur commented 10 years ago

Try to build Game Develop using WxWidgets 3.0.1.

4ian commented 10 years ago

It should be fixed with GTK3 and wxWidgets 3.0.1, I'm closing the issue, re-open another one if still facing a similar issue :)

FocusGFX commented 10 years ago

today I tried building GD on fedora-20-x86_64 and I have the same error, what is the solution ? using wxWidgets-3.0.1

4ian commented 10 years ago

Could you paste here the errors messages ? First, you could check if wxWidgets is built to be used with GTK3 (as GD is now referring explicitly to GTK3, such error will arise if wxWidgets is built using GTK2) (and so my previous messages were probably wrong, when I said to use --with-gtk=2! On the contrary, GTK3 should always be used).

I reopen the issue so that we can try to find a solution. :smiley:

FocusGFX commented 10 years ago

today I tried to build it again after building wxwidgets with ./configure --with-gtk=2 and it gave me the same error, and it looks like it still includes gtk3 !

[  7%] Building CXX object Core/CMakeFiles/GDCore.dir/GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvas.cpp.o
In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30:0,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gdk/gdkx.h:28,
                 from /mnt/4/Downloads/Linux/GameDevelopment/GameDevelop/GD/Core/GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvas.cpp:37:
/usr/include/gtk-3.0/gdk/gdktypes.h:127:39: error: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
 typedef struct _GdkWindow             GdkWindow;
                                       ^
In file included from /usr/local/include/wx-3.0/wx/event.h:14:0,
                 from /usr/local/include/wx-3.0/wx/window.h:18,
                 from /usr/local/include/wx-3.0/wx/panel.h:19,
                 from /mnt/4/Downloads/Linux/GameDevelopment/GameDevelop/GD/Core/GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvas.h:10,
                 from /mnt/4/Downloads/Linux/GameDevelopment/GameDevelop/GD/Core/GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvas.cpp:7:
/usr/local/include/wx-3.0/wx/defs.h:3414:33: error: ‘GdkWindow’ has a previous declaration as ‘typedef struct _GdkDrawable GdkWindow’
     typedef struct _GdkDrawable GdkWindow;
                                 ^
make[2]: *** [Core/CMakeFiles/GDCore.dir/GDCore/IDE/Dialogs/LayoutEditorCanvas/LayoutEditorCanvas.cpp.o] Error 1
make[1]: *** [Core/CMakeFiles/GDCore.dir/all] Error 2
4ian commented 10 years ago

Yes, as I said in my previous comment GTK3 is always included and used by GD. So wxWidgets has to use it: try to compile wxWidgets with ./configure --with-gtk=3 :wink:

victorlevasseur commented 10 years ago

I've already built GD on Arch Linux x64 and I needed some special config for wxwidgets as GCC 4.9.0/1 has a bug with wxwidgets : you should add -fno-strict-aliasing to the CXXFLAGS when using ./configure

4ian commented 10 years ago

So the commandline to use to build wxWidgets should be ./configure CXXFLAGS="-fno-strict-aliasing" --with-gtk=3 (@victorlevasseur, correct me if I make a mistake :))

victorlevasseur commented 10 years ago

Yes, but I don't remember if that fixed this error and no another one.

FocusGFX commented 10 years ago

[4ian] well, building wxwidgets with ./configure --enable-ribbon --enable-webview --with-gtk-3 successfully builds. using gcc 4.8 thanks for your help.

[victorlevasseur] using 4.8 gcc, so no need for -fno-strict-aliasing CXXFLAGS, thanks

FocusGFX commented 10 years ago

something weird though, the web export only works with firefox, but not chrome, any one know why ?

4ian commented 10 years ago

Excellent!! I close the issue. For the web export, exported files should be sent to a web server otherwise Chrome disallow the loading of local files. :) (When previewing, GD creates a mini web server so that it works with any browser).

Do you think you would be able to create a package for Archlinux ?

FocusGFX commented 10 years ago

You want me to create an rpm for Archlinux you mean ?

FocusGFX commented 10 years ago

I totally forgot about chrome not loading files without a web server, thanks

victorlevasseur commented 10 years ago

@4ian you should add a note in the doc to say that you cant use GCC 4.9.

4ian commented 10 years ago

@FocusGFX Yes, if you have some spare time, you could create a rpm :smile: (or better, a script that is used to create it, like a PKGBUILD script).

@victorlevasseur Is the error with GCC 4.9 only related to wxWidgets?

FocusGFX commented 10 years ago

[4ian] actually, I'm in a middle of a project right now, but I guess I'll finish it by tomorrow or the day after. when I'm done with it I'll create the rpm.

4ian commented 10 years ago

@FocusGFX Thanks, let me know if you get something working or need help! :smiley:

Bouh commented 4 years ago

Oops I will no use hashtags in next comments for avoid to create references.