Problems when compiling using WSL

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
JohnS
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Apr 16, 2017 6:28 pm

Problems when compiling using WSL

Post by JohnS »

I am trying to use the new windows subsystem for linux to compile some libraries so I can do some tests and have some fun with it.

I am trying to compile wxWidgets 3.1.0. I have installed

Code: Select all

libgtk2.0-dev
because configure was complaining it wasn't found.

So just like the tutorial on: https://wiki.wxwidgets.org/Compiling_an ... ng_started

I make a new directory in the source directory and run

Code: Select all

../configure --enable-debug
. This works without errors but once I run

Code: Select all

make -j4 CXXFLAGS=-std=gnu++11
it will start to compile for 10min and it will return with the following error:

Code: Select all

/root/wxWidgets-3.1.0/gtk/bk-deps g++ -c -o coredll_gtk_radiobox.o -I./.pch/wxprec_coredll -D__WXGTK__      -DWXBUILDING -I/root/wxWidgets-3.1.0/gtk/src/tiff/libtiff -I../src/tiff/libtiff -I../src/jpeg   -I../src/regex  -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0 -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/root/wxWidgets-3.1.0/gtk/lib/wx/include/gtk2-unicode-3.1 -I../include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=gnu++11 ../src/gtk/radiobox.cpp
../src/gtk/print.cpp:40:30: fatal error: gtk/gtkunixprint.h: No such file or directory
so it can't find the gtk/gtkunixprint.h file. But I have this available under:

Code: Select all

/usr/include/gtk-unix-print-2.0/gtk
Other gtk include dir that is found is:

Code: Select all

/usr/include/gtk2.0/gtk
I am a total noob regarding how all of this works but after poking around for a few hours the problems seems that during the compilation it should also compile with parameters for the gtk+-unix-print-2.0 package but it's only using the one with gtk+-2.0.

Code: Select all

# pkg-config --list-all | grep gtk
gtk+-2.0              GTK+ - GTK+ Graphical UI Library (x11 target)
gtk+-unix-print-2.0   GTK+ - GTK+ Unix print support
gtk+-x11-2.0          GTK+ - GTK+ Graphical UI Library (x11 target)
Note

Code: Select all

/usr/include/gtk-unix-print-2.0
is included here:

Code: Select all

# pkg-config --cflags gtk+-unix-print-2.0
-pthread -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
But missing here:

Code: Select all

# pkg-config --cflags gtk+-2.0
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
So I don't know how to fix this. I have allready tried reinstalling

Code: Select all

libgtk2.0-dev
.

I realize this is probably a niche question with windows subsystem for linux but I am at the end of my wit so any help is appreciated.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Problems when compiling using WSL

Post by DavidHart »

Hi,
I realize this is probably a niche question with windows subsystem for linux
Indeed, you're probably breaking new ground. I admire your courage ;) .

Two suggestions:
The ./configure --help output includes 2 options you could try:

Code: Select all

--enable-printarch      use printing architecture (You'd use --disable, of course)
--without-gtkprint      don't use GTK printing support
Failing that, I expect some creative symlinking will probably make the relevant file(s) visible inside gtk2.0/gtk. I've had to do something similar in the past, though not recently.

Regards,

David
JohnS
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Apr 16, 2017 6:28 pm

Re: Problems when compiling using WSL

Post by JohnS »

DavidHart wrote:Hi,
I realize this is probably a niche question with windows subsystem for linux
Indeed, you're probably breaking new ground. I admire your courage ;) .

Two suggestions:
The ./configure --help output includes 2 options you could try:

Code: Select all

--enable-printarch      use printing architecture (You'd use --disable, of course)
--without-gtkprint      don't use GTK printing support
Failing that, I expect some creative symlinking will probably make the relevant file(s) visible inside gtk2.0/gtk. I've had to do something similar in the past, though not recently.

Regards,

David
Thanks!

configure with

Code: Select all

--disable-printarch
and

Code: Select all

--without-gtkprint 
worked. I can run wxWidgets apps under WSL and send the output to an xserver. Still weird that I couldn't compile normally. I would like to get to the bottom of why this occured.
Post Reply