Linux: program is looking for an old version of wxGTK

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

Hi, ALL,
I built latest release of wxWidget (3.1.7) on Linux with configure + make + make install + ldconfig.
Then I build my program with the same way - configure + make + make install (I'm using Anjuta IDE).

Unfortunately when I tried to run the program it says:

"Cannot find the file libwx_gtk3u_xrc-3.1.so.4".

I don't know how it is posible - I ran ldconfig so the linker should pick up the new version.
And there was no error during the build.

Could someone please shed some light here? Where is this old version comes from?

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

Re: Linux: program is looking for an old version of wxGTK

Post by DavidHart »

Hi,
I built latest release of wxWidget (3.1.7) on Linux
Which distro/version?
with configure + make + make install + ldconfig.
So you installed wx3.1.7 to /usr/local/ rather than to /usr/. Not all distros will look there for libs. Passing --prefix=/usr/ to configure is safer (but see my last paragraph).
"Cannot find the file libwx_gtk3u_xrc-3.1.so.4".
So you have a wx3.1.4 build installed too, and that was the wx build that anjuta used for your program. Have a look at its compiler/linker settings and see if you 'hard-coded' that in.
Also, look at the result of doing, in a terminal:
wx-config --version
and
wx-config --libs

Depending on your distro (they don't all use it) you might also get interesting output from:
update-alternatives --display wx-config

Finally, this sort of problem is why I'm forever recommending that people don't make install. Instead, 'install' into a subdir in the wx source dir, and configure with:
--prefix=$(pwd)
So my bash alias for a GTK+3 build is:

Code: Select all

(mkdir -p udb && cd udb && ../configure --with-gtk=3 --prefix=$(pwd) --enable-debug --enable-cxx11 && make -j`nproc`)
To use that build, just point to /full/path/to/udb/wx-config in your terminal, or in the anjuta settings.

Regards,

David
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

Hi, David,
DavidHart wrote: Sun Jul 03, 2022 9:26 am Hi,
I built latest release of wxWidget (3.1.7) on Linux
Which distro/version?
I am using Gentoo Linux.
DavidHart wrote: Sun Jul 03, 2022 9:26 am
with configure + make + make install + ldconfig.
So you installed wx3.1.7 to /usr/local/ rather than to /usr/. Not all distros will look there for libs. Passing --prefix=/usr/ to configure is safer (but see my last paragraph).
Yes, not all of them.
But I ran "ldconfig", which should update the search path/links for dynamic linker...
DavidHart wrote: Sun Jul 03, 2022 9:26 am
"Cannot find the file libwx_gtk3u_xrc-3.1.so.4".
So you have a wx3.1.4 build installed too, and that was the wx build that anjuta used for your program. Have a look at its compiler/linker settings and see if you 'hard-coded' that in.
Had. ;-)
When I'm upgrading I am deleting the previous version sources by doing "cd wxWidgets && rm -rf *"
Then I download new release and unpack it into the "wxWidgets" directory.

As far as I can tell I didn't hardcode anything - I used `wx-config --cxxflags` and `wx-config --libs` everywhere.
But I will re-check all projects in Anjuta just to be 200% sure.
DavidHart wrote: Sun Jul 03, 2022 9:26 am Also, look at the result of doing, in a terminal:
wx-config --version
and
wx-config --libs

Depending on your distro (they don't all use it) you might also get interesting output from:
update-alternatives --display wx-config
Nah, Gentoo doesn't use that "update-alternatives" script.
DavidHart wrote: Sun Jul 03, 2022 9:26 am Finally, this sort of problem is why I'm forever recommending that people don't make install. Instead, 'install' into a subdir in the wx source dir, and configure with:
--prefix=$(pwd)
So my bash alias for a GTK+3 build is:

Code: Select all

(mkdir -p udb && cd udb && ../configure --with-gtk=3 --prefix=$(pwd) --enable-debug --enable-cxx11 && make -j`nproc`)
To use that build, just point to /full/path/to/udb/wx-config in your terminal, or in the anjuta settings.

Regards,

David
I will try that when this problem is resolved.. ;-)

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

Re: Linux: program is looking for an old version of wxGTK

Post by DavidHart »

OK.

And the output of doing, in a terminal:
wx-config --version
and
wx-config --libs

If that's not what you're expecting, also try doing:
which wx-config
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,

Code: Select all

igor@IgorReinCloud ~ $ wx-config --version
3.1.7
igor@IgorReinCloud ~ $ wx-config --libs
-L/usr/local/lib -pthread   -lwx_gtk3u_xrc-3.1 -lwx_gtk3u_html-3.1 -lwx_gtk3u_qa-3.1 -lwx_gtk3u_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1 
igor@IgorReinCloud ~ $ which wx-config
/usr/local/bin/wx-config
igor@IgorReinCloud ~ $ 
Thank you.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Linux: program is looking for an old version of wxGTK

Post by DavidHart »

Which is what it should be.

So, by a process of elimination,
But I will re-check all projects in Anjuta just to be 200% sure.
check your current project settings as they're the likeliest thing to be wrong.

If you're sure they're OK, maybe you have 2 instances of your binary installed and you're trying to run an old, linked-to-wx3.1.4, one.
If you can't see >1, try using 'locate' (if it's available on your system) or 'find'.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,
I checked - there is only one instance:

Code: Select all

IgorReinCloud / # find . -name dbhandler
./home/igor/dbhandler
./home/igor/dbhandler/dbhandler
./home/igor/dbhandler/Debug/dbhandler
./home/igor/dbhandler/Debug/dbhandler/dbhandler
./usr/local/bin/dbhandler
./usr/local/share/doc/dbhandler
find: ‘./proc/2778/task/2778/net’: Invalid argument
find: ‘./proc/2778/net’: Invalid argument
find: ‘./run/user/1000/doc’: Permission denied
IgorReinCloud / # 
So, I will now check the Anjuta project...

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,
I re-checked - all projects are using `wx-config --libs` in the Makefile.am/in.

What else could be wrong?

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

Re: Linux: program is looking for an old version of wxGTK

Post by DavidHart »

I re-checked - all projects are using `wx-config --libs` in the Makefile.am/in.
If that's literally what they contain, there's still potential for problems. If you run the resulting Makefile in a terminal, the wx-config that's called will depend on that terminal's $PATH. For example, to use a particular wx-config I often open a new terminal and do:
PATH=/some/path/to/wx-config: $PATH
However that's probably not the problem here.
I checked - there is only one instance:

Code: Select all

./home/igor/dbhandler/dbhandler
./home/igor/dbhandler/Debug/dbhandler/dbhandler
./usr/local/bin/dbhandler
Unless some of those are directories, I make that 3.

What is the result of doing, in a terminal:

Code: Select all

ldd /usr/local/bin/dbhandler | grep libwx_gtk3u_xrc
Similarly try with the other 2 inside /home/igor/dbhandler/
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,
Can you explain this:

Code: Select all

igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/bin/dbhandler | grep libwx_gtk3u_xrc
	libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f74f5866000)
igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/lib/libdialogs.so | grep libwx_gtk3u_xrc
	libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f49dd3f4000)
	libwx_gtk3u_xrc-3.1.so.4 => not found
	libwx_gtk3u_xrc-3.1.so.4 => not found
igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/lib/libdbloader.so | grep libwx_gtk3u_xrc
	libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f15b44ba000)
igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/lib/libdbwindow.so | grep libwx_gtk3u_xrc
	libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f31a3985000)
	libwx_gtk3u_xrc-3.1.so.4 => not found
	libwx_gtk3u_xrc-3.1.so.4 => not found
	libwx_gtk3u_xrc-3.1.so.4 => not found
igor@IgorReinCloud ~/dbhandler $ 

Code: Select all

igor@IgorReinCloud ~/dbhandler/libdialogs $ cat Makefile.am 
## Process this file with automake to produce Makefile.in


lib_LTLIBRARIES =  \
	libdialogs.la

libdialogs_la_SOURCES =  \
	databasetype.cpp \
	databasetype.h \
	dialogs.cpp \
	odbcconfigure.cpp \
	odbcconfigure.h \
	selecttables.cpp \
	selecttables.h \
	createindex.cpp \
	createindex.h \
	properties.cpp \
	properties.h \
	foreignkey.cpp \
	foreignkey.h \
	getobjectname.cpp \
	getobjectname.h \
	jointype.cpp \
	jointype.h \
	addcolumnsdialog.cpp \
	addcolumnsdialog.h \
	odbccredentials.cpp \
	odbccredentials.h \
	bitmappanel.cpp \
	bitmappanel.h \
	newquery.cpp \
	newquery.h \
	quickselect.cpp \
	quickselect.h \
	retrievalarguments.cpp \
	retrievalarguments.h \
	typecombobox.cpp \
	typecombobox.h \
	gotoline.cpp \
	gotoline.h \
	attachdb.cpp \
	attachdb.h \
	detachdb.cpp \
	detachdb.h

libdialogs_la_CXXFLAGS = -I../../dbinterface \
	-I../../libfieldswindow \
	-I../../libshapeframework \
	-I../../libpropertypages \
	-I../../libpropertieshandlers \
	`pkg-config \
	--cflags \
	gtk+-3.0` \
	`/home/igor/wxWidgets/buildGTK/wx-config \
	--cxxflags` 

libdialogs_la_LDFLAGS = -L../libsqlite \
	-L../libshapeframework \
	-L../dbinterface \
	-L../libfieldswindow \
	-L../libodbc \
	-L../libpostgres \
	-L../libpropertypages \
	-Wl,-rpath,/home/igor/dbhandler/Debug/libpropertypages/.libs \
	-ldbinterface \
	-lsqlite_lib \
	-lodbc_lib \
	-lshapeframework \
	-lfieldswindow \
	-lpropertypages \
	-lpostgres \
	`/home/igor/wxWidgets/buildGTK/wx-config \
	--libs`
	
	 
igor@IgorReinCloud ~/dbhandler/libdialogs $ 

Code: Select all

igor@IgorReinCloud ~/dbhandler/libdialogs $ cd ../libdbloader/
igor@IgorReinCloud ~/dbhandler/libdbloader $ cat Makefile.am 
## Process this file with automake to produce Makefile.in


lib_LTLIBRARIES =  \
	libdbloader.la

libdbloader_la_SOURCES =  \
	dbloader.cpp

libdbloader_la_CXXFLAGS = -I/usr/include \
	-I../../dbinterface \
	-I../../libsqlite \
	-I../../libodbc \
	-I../../libpostgres \
	-I../../libmysql \
	`mysql_config \
	--cflags` \
	`/home/igor/wxWidgets/buildGTK/wx-config \
	--cxxflags` 

libdbloader_la_LDFLAGS = -L../libsqlite \
	-L../libodbc \
	-L../libpostgres \
	-L../libmysql \
	`/home/igor/wxWidgets/buildGTK/wx-config \
	--libs` \
	-lsqlite_lib \
	-lodbc_lib \
	-lpostgres \
	`mysql_config \
	--libs`
	 
	 
igor@IgorReinCloud ~/dbhandler/libdbloader $ 
Both subprojects are using the same wx-config, yet one still has a reference to the old version of wx...

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

Re: Linux: program is looking for an old version of wxGTK

Post by DavidHart »

It does seem weird, but the only explanation I can think of is that, when libdialogs.so and libdbwindow.so were built, wx3.1.4 (or bits of it) were still on your system, and somehow the linker managed to link to both 3.1.4 and 3.1.7. So, now that 3.1.4 no longer exists, those libs can't be used successfully.

I suggest you make clean (very clean!) your project, make uninstall what's currently installed, and then check with your filemanager that those faulty libs really are gone. Finally, build again.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,
And this is even more weird:

Code: Select all

igor@IgorReinCloud ~/dbhandler/Debug/libdialogs $ ldd .libs/libdialogs.so | grep libwx_gtk3u_xrc
	libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f377cf7c000)
igor@IgorReinCloud ~/dbhandler/Debug/libdialogs $ cd ../libdbwindow/
igor@IgorReinCloud ~/dbhandler/Debug/libdbwindow $ ldd .libs/libdbwindow.so | grep libwx_gtk3u_xrc
	libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f0e058f9000)
igor@IgorReinCloud ~/dbhandler/Debug/libdbwindow $ 
All this is actually means that for some reason "make install" portion of the main Makefile somehow end up with the references to the old wx version.

What do you think I should do?
Is there a simple way to regenerate Makefile so that everything works?

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

Re: Linux: program is looking for an old version of wxGTK

Post by DavidHart »

I'm not sure I understand what (if anything) you've just done. Did you uninstall, make clean, rebuild, and this is the result?
Or are those the same files as yesterday?

Again, did you just rebuild and make install to /usr/local? Or does /usr/local still contain the original, faulty, libs?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,
No, I didn't do anything (yet).

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linux: program is looking for an old version of wxGTK

Post by ONEEYEMAN »

David,
I now manually removed my application and all of its libraries, rebuilt it and installed it.

And when running it is still looking for that .4 version.

Can you explain that?

Thank you.
Post Reply