User forums > General (but related to Code::Blocks)

wxGTK fails to compile

(1/2) > >>

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:


--- 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]
--- End code ---

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

--- Code: ---sudo apt-cache search libwxgt*
--- End code ---
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)

--- End code ---
It appears I already had wxGTK installed. So I have skipped this part of the Code::Blocks compile procedure.

Navigation

[0] Message Index

[#] Next page

Go to full version