Author Topic: MouseSap fails to compile with wxgtk + gtk3  (Read 527 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2177
MouseSap fails to compile with wxgtk + gtk3
« on: September 28, 2019, 10:13:42 pm »
...snipped...
mouse-sap plugins (which btw fails to compile with wxgtk + gtk3 :( )

I'm very confused about what to install on Mint19 reguarding wxgtk + gtk3.
The instructions at [http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux do not match the wxWidgets web page.

When I click on the download button then "source for linux" on the wxWidgets webpage, it wants to download wxWidgets-3.1.2.tar.bz2.
Is that the same as wxgtk ?

Is my synaptic showing that wxgtk is present on my system. Is that actually wxWidgets?

.
« Last Edit: September 28, 2019, 10:16:11 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12069
    • Travis build status
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #1 on: September 29, 2019, 01:38:15 am »
Yes, it is the same thing. Use wx-config --list to see what versions you have installed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2177
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #2 on: September 30, 2019, 08:09:33 am »
After two day of work, I cannot get CB to compile using gtk3, much less solve the MouseSap plugin problems (using Mint 19 based on gtk3).

So..., I'll remove all use of gtk from MouseSap to get it to work under windows and Linux gtk2 and disable it for use under gtk3 until CB itself compiles using gtk3.

I'm just not savvy enough on Linux to solve the gtk3 compiler errors in scintilla.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12069
    • Travis build status
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #3 on: September 30, 2019, 02:43:33 pm »
What do you mean by compiler errors? If you're using autotools it compiles fine. If you're using projects you have to find all mentions of pkg-config for gtk and gdk and replace -2.0 with -3.0 and it should build fine at least the core.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2177
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #4 on: September 30, 2019, 05:25:26 pm »
What do you mean by compiler errors? If you're using autotools it compiles fine. If you're using projects you have to find all mentions of pkg-config for gtk and gdk and replace -2.0 with -3.0 and it should build fine at least the core.

Code: [Select]
g++ -Wall -g -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DcbDEBUG -DCB_PRECOMP -std=c++11 -pthread -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D__WX__ -DGTK -DLINK_LEXERS -DSCI_LEXER -DWXMAKINGDLL_SCI -iquote.objs30/include -I.objs30/include -I. -Isdk/wxscintilla/include -Iinclude/tinyxml -Isdk/wxscintilla/src/scintilla/include -Isdk/wxscintilla/src/scintilla/src -Isdk/wxscintilla/src/scintilla/lexlib -c /home/pecan/proj/cbBeta30/trunk/src/sdk/wxscintilla/src/ScintillaWX.cpp -o .objs30/sdk/wxscintilla/src/ScintillaWX.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 /home/pecan/proj/cbBeta30/trunk/src/sdk/wxscintilla/src/ScintillaWX.cpp:58:
/usr/include/gtk-3.0/gdk/gdktypes.h:143:39: error: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
 typedef struct _GdkWindow             GdkWindow;
                                       ^~~~~~~~~
In file included from /usr/include/wx-3.0/wx/wxprec.h:12:0,
                 from /home/pecan/proj/cbBeta30/trunk/src/sdk/wxscintilla/src/ScintillaWX.cpp:17:
/usr/include/wx-3.0/wx/defs.h:3466:33: note: previous declaration as ‘typedef struct _GdkDrawable GdkWindow’
     typedef struct _GdkDrawable GdkWindow;
                                 ^~~~~~~~~
Process terminated with status 1 (3 minute(s), 29 second(s))
1 error(s), 4 warning(s) (3 minute(s), 29 second(s))
 

There's an include "-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0" that I think should be "...gtk3..." instead. But I cannot figure out where it's coming from.

Offline sodev

  • Regular
  • ***
  • Posts: 329
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #5 on: September 30, 2019, 05:35:47 pm »
I don't think i've ever build CodeBlocks with CodeBlocks on Linux but i guess the project files contain plain calls to wx-config and your wx-config defaults to the gtk2 variant. In autotools builds i just specifiy the wx-config script of the variant i want to use, a hotfix for your case might be to change the wx-config script, which is only a symlink to the real script, to point the the script of the gtk3 variant.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2177
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #6 on: September 30, 2019, 06:33:30 pm »
... a hotfix for your case might be to change the wx-config script, which is only a symlink to the real script, to point the the script of the gtk3 variant.

Where is location of the wx-config script?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12069
    • Travis build status
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #7 on: September 30, 2019, 06:39:41 pm »
1. Go to Project -> Build options -> select the root in the tree -> Custom variables
2. WX_CONFIG to "wx-config --version=3.0 --toolkit=gtk3"

I thought you've already passed this step, that's why I've not mentioned it. This is going to work only if wx-config --list returns an output which has a gtk3 version. If not you'll have to change the whole wx-config to point to the correct version of this script.

p.s. You'll have to do this for every plugin project you need to build. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sodev

  • Regular
  • ***
  • Posts: 329
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #8 on: September 30, 2019, 06:52:13 pm »
Where is location of the wx-config script?

Depends on your system, for me it is:
Code: [Select]
$ which wx-config
/usr/local/bin/wx-config

$ ls -l /usr/local/bin
wx-config -> /usr/local/lib64/wx/config/gtk3-unicode-3.1

The other scripts will be in a similar location. This is faster than editing every CodeBlocks project file :)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2177
Re: MouseSap fails to compile with wxgtk + gtk3
« Reply #9 on: October 02, 2019, 12:39:09 am »
Fixed in head r11871 (maybe).

I removed all direct GTK calls. Hopefully this fixes the problem on wxGTK with GTK 3.
But I cannot test that since I cannot get CodeBlocks to compile on Mint 19 using GTK3.

I'd appreciate it if someone running GTK3 would try to compile MouseSap and report the actual errors.