Linux: program is looking for an old version of wxGTK
Linux: program is looking for an old version of wxGTK
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.
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.
Re: Linux: program is looking for an old version of wxGTK
Hi,
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:
To use that build, just point to /full/path/to/udb/wx-config in your terminal, or in the anjuta settings.
Regards,
David
Which distro/version?I built latest release of wxWidget (3.1.7) on Linux
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).with configure + make + make install + ldconfig.
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."Cannot find the file libwx_gtk3u_xrc-3.1.so.4".
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`)
Regards,
David
Re: Linux: program is looking for an old version of wxGTK
Hi, David,
But I ran "ldconfig", which should update the search path/links for dynamic linker...
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.
Thank you.
I am using Gentoo Linux.
Yes, not all of them.
But I ran "ldconfig", which should update the search path/links for dynamic linker...
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.
Nah, Gentoo doesn't use that "update-alternatives" script.
I will try that when this problem is resolved..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:To use that build, just point to /full/path/to/udb/wx-config in your terminal, or in the anjuta settings.Code: Select all
(mkdir -p udb && cd udb && ../configure --with-gtk=3 --prefix=$(pwd) --enable-debug --enable-cxx11 && make -j`nproc`)
Regards,
David
Thank you.
Re: Linux: program is looking for an old version of wxGTK
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
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
Re: Linux: program is looking for an old version of wxGTK
David,
Thank you.
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 ~ $
Re: Linux: program is looking for an old version of wxGTK
Which is what it should be.
So, by a process of elimination,
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'.
So, by a process of elimination,
check your current project settings as they're the likeliest thing to be wrong.But I will re-check all projects in Anjuta just to be 200% sure.
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'.
Re: Linux: program is looking for an old version of wxGTK
David,
I checked - there is only one instance:
So, I will now check the Anjuta project...
Thank you.
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 / #
Thank you.
Re: Linux: program is looking for an old version of wxGTK
David,
I re-checked - all projects are using `wx-config --libs` in the Makefile.am/in.
What else could be wrong?
Thank you.
I re-checked - all projects are using `wx-config --libs` in the Makefile.am/in.
What else could be wrong?
Thank you.
Re: Linux: program is looking for an old version of wxGTK
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:I re-checked - all projects are using `wx-config --libs` in the Makefile.am/in.
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
What is the result of doing, in a terminal:
Code: Select all
ldd /usr/local/bin/dbhandler | grep libwx_gtk3u_xrc
Re: Linux: program is looking for an old version of wxGTK
David,
Can you explain this:
Both subprojects are using the same wx-config, yet one still has a reference to the old version of wx...
Thank you.
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 $
Thank you.
Re: Linux: program is looking for an old version of wxGTK
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.
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.
Re: Linux: program is looking for an old version of wxGTK
David,
And this is even more weird:
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.
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 $
What do you think I should do?
Is there a simple way to regenerate Makefile so that everything works?
Thank you.
Re: Linux: program is looking for an old version of wxGTK
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?
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?
Re: Linux: program is looking for an old version of wxGTK
David,
No, I didn't do anything (yet).
Thank you.
No, I didn't do anything (yet).
Thank you.
Re: Linux: program is looking for an old version of wxGTK
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.
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.