Compiling wxWidgets on Linux Mint 18.3

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
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

Compiling wxWidgets on Linux Mint 18.3

Post by dkaip »

I just clone wxWidgets. After configure and make, i can not find the solution of error.
Mint i just new installation, in last sylvia(ver 18.3) version.
Any idea?
a@a-desktop ~/wxWidgets-3.1.0/gtk-build $ make CXXFLAGS="-std=c++11"
/home/a/wxWidgets-3.1.0/gtk-build/bk-deps g++ -c -o monolib_print.o -I./.pch/wxprec_monolib -D__WXGTK__ -DWXBUILDING -I/home/a/wxWidgets-3.1.0/gtk-build/src/tiff/libtiff -I../src/tiff/libtiff -I../src/jpeg -I../src/regex -I../src/stc/scintilla/include -I../src/stc/scintilla/lexlib -I../src/stc/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/home/a/wxWidgets-3.1.0/gtk-build/lib/wx/include/gtk2-unicode-static-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=c++11 ../src/gtk/print.cpp
../src/gtk/print.cpp:40:30: fatal error: gtk/gtkunixprint.h: Δεν υπάρχει τέτοιο αρχείο ή κατάλογος
compilation terminated.
Makefile:23752: recipe for target 'monolib_print.o' failed
make: *** [monolib_print.o] Error 1
I have install all libgtk* libs ...
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Compiling wxWidgets on Linux Mint 18.3

Post by eranon »

Do not cross-post, please (first occurrence here: viewtopic.php?f=30&t=44145). Also, when you have an important part of the message in a non-english language, translate it (it prevents those who want to help you from doing it).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compiling wxWidgets on Linux Mint 18.3

Post by doublemax »

Check the configure log, maybe some printing related things are missing.
Use the source, Luke!
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by dkaip »

config.log ends
configure: exit 0
I use
../configure --enable-unicode --enable-monolithic --enable-debug --with-gtk --disable-shared --with-opengl --prefix=$(pwd)
As i see there is not such file gtk/gtkunixprint.h.
I think that the last Mint uses only gtk3, so i have write maybe some changes must be done to lib?
This is a thought only. I must install Mint 17.3 in virtual machine to see if i have write.
Thanks
Jim.
*Sorry for language.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by stahta01 »

Try

Code: Select all

--with-gtk=3
to use GTK version 3

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by stahta01 »

This option is not often used under Linux "--enable-monolithic"; you might want to try removing it and deleting the build folder if you have more problems.
But, first decide if you want to build against GTK version 2.x or version 3.x.

Tim S.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Compiling wxWidgets on Linux Mint 18.3

Post by DavidHart »

Hi,

Have you installed the gtk+2, or +3, dev package and its dependencies? They're probably called libgtk2.0-dev or libgtk-3-dev.

Regards,

David
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by dkaip »

I have install gtk2.0 e.t.c.
The option --enable-monolithic i always use in Linux. Until now i had no problem.
Noy i am tryin in configure the option --with-gtk=3 but fault again.
c/tiff/libtiff -I../src/tiff/libtiff -I../src/jpeg -I../src/regex -I../src/stc/scintilla/include -I../src/stc/scintilla/lexlib -I../src/stc/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -D_FILE_OFFSET_BITS=64 -I/home/a/wxWidgets-3.1.0/gtk-build/lib/wx/include/gtk3-unicode-static-3.1 -I../include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 ../src/gtk/print.cpp
../src/gtk/print.cpp:40:30: fatal error: gtk/gtkunixprint.h: no such file or folder ...
Makefile:23755: recipe for target 'monolib_print.o' failed
make: *** [monolib_print.o] Error 1
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by stahta01 »

Did you install libgtk-3-dev like DavidHart suggested?

Tim S.
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by dkaip »

Yes.
libgtk-3-dev is already the newest version (3.18.9-1ubuntu3.3).
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Compiling wxWidgets on Linux Mint 18.3

Post by DavidHart »

I just built a recent wx git in a Mint 18.3 VirtualBox guest. I installed libgtk2.0-dev and build-essential, plus the opengl dependencies, then used a simplified version of your configure line (much of which was unnecessary):

Code: Select all

../configure --enable-monolithic --disable-shared --with-opengl --prefix=$(pwd)
It then built without any problem.

Do you definitely have libgtk2.0-dev installed?
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by dkaip »

Yes, when write ...
sudo apt-get install libgtk2.0-dev
libgtk2.0-dev is already the newest version (2.24.30-1ubuntu1.16.04.2)
I am trying to find gtk/gtkunixprint.h file, and i can not find. Now i am trying to mint 18.3 in virtual machine, if my Mint install has something wrong.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Compiling wxWidgets on Linux Mint 18.3

Post by DavidHart »

I successfully built using 'make -j'. However I just tried again using 'make CXXFLAGS="-std=c++11"' and this time I did get your build error.

Clearly setting c++11 on Mint 18.3 isn't essential. However if you feel you must do something, the 4 year old commit 4bba79994f says:

Code: Select all

C++11 note: If you want to compile wxWidgets in C++11 mode, you currently have
            to use -std=gnu++11 switch as -std=c++11 disables some extensions
            that wxWidgets relies on. I.e. please use CXXFLAGS="-std=gnu++11".
That information might be outdated but would be worth trying.
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

Re: Compiling wxWidgets on Linux Mint 18.3

Post by dkaip »

I have many times install Mint 18.3 and 18.2 (not in virtual) for study.
When download from git always i have the known problems.
Last time i download wxWid..3.0.1.tar.gz2 and extract.
../configure --enable-unicode --enable-monolithic --enable-debug --with-gtk --disable-shared --with-opengl --prefix=$(pwd)
and
../configure --enable-unicode --enable-monolithic --enable-debug --with-gtk --disable-shared --with-opengl --enable-webview --prefix=$(pwd)
I have same problem..
/usr/bin/ld: /home/a/wxWidgets-3.1.0/gtk-build1/lib/libwx_gtk2u-3.1.a(monolib_xml.o)||undefined reference to symbol 'XML_SetUserData'|
I wiil try without monolithic later for test.
Always for all wxWd* dir fron tar or git with make -j, building terminate progressing and shutdown system.
I am trying all that things and i will upload results.
Thank's
Jim
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Compiling wxWidgets on Linux Mint 18.3

Post by DavidHart »

Always for all wxWd* dir fron tar or git with make -j, building terminate progressing and shutdown system.
I often get that too, mostly in VirtualBox guests, with make -j. Or sometimes compiling is very slow, or gcc aborts complaining of lack of space on the device. It happens because of running out of memory in /tmp (which gcc uses during builds and which nowadays is usually mounted as tmpfs) and/or running out of swap space.

One fix is to specify e.g. -j3, where 3 is less than the total number of available CPUs. Alternatively you can build elsewhere by doing:
export TMPDIR=/somewhere/else
make -j
Post Reply