Author Topic: wxGTK fails to compile  (Read 5312 times)

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
wxGTK fails to compile
« on: January 27, 2019, 05:15:20 am »
I attempted to compile and package Code::Blocks by following the instructions at:
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux

Those instructions failed at the point of the make command under the heading "Building wxWidgets" where I got many repetitions of errors similar to these:

Code
In file included from ../src/gtk/dcclient.cpp:46:0:
../src/gtk/bdiag.xbm:6:50: error: narrowing conversion of ‘128’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]
    0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01};
                                                  ^
../src/gtk/bdiag.xbm:6:50: error: narrowing conversion of ‘128’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]

It appears a change in the compiler has caused a practice that was not an error before, to be an error now. On this thread there are several solutions offered:

https://stackoverflow.com/questions/51861932/error-narrowing-conversion-of-199-from-int-to-char-inside-wnarrowin

Which of them would be the appropriate one to get this to compile? Are there any other solutions that would be better?

The file I downloaded for this compile attempt is named "wxGTK-2.8.12.tar.gz".

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: wxGTK fails to compile
« Reply #1 on: January 27, 2019, 05:31:48 am »
Interesting, looks like array initializers are now treated like brace initializer, i guess they had no choice because of the same syntax.

Simple solution, dont use this ancient version of wxWidgets. It is almost 8 years old, current CodeBlocks revisions work well enough with wxWidgets 3.x. Maybe dont use the latest release, i think CodeBlocks has issues with that.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Re: wxGTK fails to compile
« Reply #2 on: January 27, 2019, 10:49:58 am »
The main issues with wx3.1.2 are related to MSW-specific code, the Linux version seems to work OK.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: wxGTK fails to compile
« Reply #3 on: January 27, 2019, 02:51:45 pm »
I would use the system default wxWidgets library and not compile it by yourself...

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: wxGTK fails to compile
« Reply #4 on: January 28, 2019, 08:54:01 pm »
I executed the command
Code
sudo apt-cache search libwxgt*
and got the the response:
Code
libwxgtk-media3.0-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ media library runtime)
libwxgtk-media3.0-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ media library development)
libwxgtk-media3.0-gtk3-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ 3 media library runtime)
libwxgtk-media3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ 3 media library development)
libwxgtk-webview3.0-gtk3-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ 3 webview library runtime)
libwxgtk-webview3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ 3 webview library development)
libwxgtk3.0-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
libwxgtk3.0-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ development)
libwxgtk3.0-gtk3-0v5 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ 3 runtime)
libwxgtk3.0-gtk3-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ 3 development)
It appears I already had wxGTK installed. So I have skipped this part of the Code::Blocks compile procedure.

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: wxGTK fails to compile
« Reply #5 on: February 06, 2019, 10:10:20 pm »
I got a wxGTK version to compile. This time I tried compiling the version in file: "wxWidgets-3.0.3.tar.bz2". I expanded it in the path /opt/wxWidgets-3.0.3/ and followed the directions at
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux
under the heading "Building wxWidgets". I did make minor changes to instructions to take into account the more recent version number.
I know that not even 3.0.3 is the latest version. But the project I work on was started when it was the most recent version. When I attempted to upgrade to version 3.0.4 there were compile errors I did not have time to figure out how to fix.

The version I tried when I had the trouble I opened this thread for was too old.