I have installed wxWidgets with GTK2 and GTk3 on the same OS.
wxPdfDocument automatticaly compiles with GTK3.
How to make it to comple with GTK2?
Thank you
wxPdfDocument how to select wich version of GTK to use
Re: wxPdfDocument how to select wich version of GTK to use
Hi,
I don't know anything about wxPdfDocument (and you don't give any details about how you are building it) but I suspect that your issue is an example of the standard 'which wx version to use?' question.
When building any program against wx on Linux, its makefile (or similar) will probably use the first wx-config script it finds. If you don't do anything special, that will be the first found in your $PATH; and that will be the one selected in update-alternatives.
So, look at the output of doing, as root:
update-alternatives --config wx-config
If the default is not what you want, you can change it there.
Alternatively (and perhaps more relevant to your situation) if you wish to use a different wx build, especially one that isn't installed, just point to its wx-config in your makefile; or in your IDE compilation and linking settings; or prepend its filepath to your build-terminal's $PATH
e.g. PATH=/full/path/to/preferred/wx-config:$PATH
Regards,
David
I don't know anything about wxPdfDocument (and you don't give any details about how you are building it) but I suspect that your issue is an example of the standard 'which wx version to use?' question.
When building any program against wx on Linux, its makefile (or similar) will probably use the first wx-config script it finds. If you don't do anything special, that will be the first found in your $PATH; and that will be the one selected in update-alternatives.
So, look at the output of doing, as root:
update-alternatives --config wx-config
If the default is not what you want, you can change it there.
Alternatively (and perhaps more relevant to your situation) if you wish to use a different wx build, especially one that isn't installed, just point to its wx-config in your makefile; or in your IDE compilation and linking settings; or prepend its filepath to your build-terminal's $PATH
e.g. PATH=/full/path/to/preferred/wx-config:$PATH
Regards,
David
Re: wxPdfDocument how to select wich version of GTK to use
Hello!
I build it with ./configure
if I run
I got error
if I run
I got
I build it with ./configure
Code: Select all
mkdir build-gtk [or any other suitable name]
cd build-gtk
../configure [here you should use the same flags you used to configure wxWidgets]
make
Code: Select all
sudo update-alternatives --config wx-config
Code: Select all
no altenatives for wx-config
Code: Select all
wx-config --list
Code: Select all
Default config is gtk3-unicode-3.1
Default config will be used for output
Alternate matches:
gtk2-unicode-3.1
Re: wxPdfDocument how to select wich version of GTK to use
So that's why the gtk3 build is being used.Default config is gtk3-unicode-3.1
How did you configure/install your 2 wx builds? Did you:
../configure --with-gtk=<whichever> && make && sudo make install
or (the way I much prefer):
../configure --with-gtk=<whichever> --prefix=$(pwd) && make
The first way would install to /usr/local/. The second way would not install it anywhere; instead it can be used where it is.
Either way, before you configure wxPdfDocument, you need to point the terminal's $PATH at the /full/path/to/gtk2-build:
PATH=/full/path/to/my/wxgtk2-build-dir/wx-config:$PATH
Re: wxPdfDocument how to select wich version of GTK to use
Tank you
I used wx builds without prefixes
I found wxPdfDocument configure switches
I'll try to build wx the other way
I used wx builds without prefixes
Code: Select all
../configure --enable-shared --enable-unicode --with-gtk=2
Code: Select all
--with-wxdir=PATH Use uninstalled version of wxWidgets in PATH
--with-wx-config=CONFIG wx-config script to use (optional)
--with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)