News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

wxGTK fails to compile

Started by spflanze, January 27, 2019, 05:15:20 AM

Previous topic - Next topic

spflanze

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:

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".

sodev

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.

Miguel Gimenez

The main issues with wx3.1.2 are related to MSW-specific code, the Linux version seems to work OK.

BlueHazzard

I would use the system default wxWidgets library and not compile it by yourself...

spflanze

I executed the command
sudo apt-cache search libwxgt*
and got the the response:
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.

spflanze

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.