1. open_dll problem
- Posted by peterR May 12, 2016
- 1812 views
Hi all
Back here after a long, long time, and immediately in trouble. Here's the code to demonstrate the issue:
include std/dll.e include std/text.e include std/filesys.e sequence lib_file = "/usr/lib64/libgtk-3.so.0" atom lib_handle = open_dll( lib_file ) puts( 1, "dll handle = " & sprint( lib_handle ) & "\n" ) puts(1, "File length of /usr/lib64/libgtk-3.so.0 = " & sprint( file_length( lib_file ) ) )
Here's the output:
dll handle = 0
File length of /usr/lib64/libgtk-3.so.0 = 7187144
So the library won't open, but it is found by the file_length() function. What am I missing? Why can't I open gtk?
PeterR
2. Re: open_dll problem
- Posted by ChrisB (moderator) May 12, 2016
- 1781 views
Hi Pete
You're probably more familiar with this stuff than me. Things to consider
- 64 bittedness - 32 bit eu and 64 bit so - need 32 bit libs and dependencies (nightmare)
- so location - sometimes doesn't like where it is - put a symlink to the library somewhere else
- library dependencies - use nm and ldd to trace them, see if any missing
Cheers
Chris
PS - I'm using Linux less these days, and can actually feel my Linux foo fading!
3. Re: open_dll problem
- Posted by irv May 12, 2016
- 1764 views
Be sure Eu is 64 bit. That is most likely the cause of the prob.
However, the location of the gtk 3 so seems unusual (to me). On all of the recent distros I've tried, it's found at /usr/lib/x86_64 or /usr/lib/x86_64-linux-gnu. What distro are you using?
4. Re: open_dll problem
- Posted by jimcbrown (admin) May 12, 2016
- 1788 views
PS - I'm using Linux less these days, and can actually feel my Linux foo fading!
Ouch! Sorry to hear that. It is most unfortunate.
5. Re: open_dll problem
- Posted by jimcbrown (admin) May 12, 2016
- 1773 views
However, the location of the gtk 3 so seems unusual (to me). On all of the recent distros I've tried, it's found at /usr/lib/x86_64 or /usr/lib/x86_64-linux-gnu. What distro are you using?
I think /usr/lib64 might be an older standard. CentOS 5.2 puts 64bit so in /usr/lib64, for example.
7. Re: open_dll problem
- Posted by ghaberek (admin) May 12, 2016
- 1765 views
I wouldn't even bother with the path. If you share your code with someone whose shared libraries are in a different location, the code will stop working. These things should be included in the default search path or, if necessary, update your LD_LIBRARY_PATH to point to where the shared libraries live.
-Greg
8. Re: open_dll problem
- Posted by peterR May 12, 2016
- 1739 views
Hi all Thanks for the suggestions. I'm at work now, but I'm thinking the "bittedness" idea makes most sense. I'll check out Irv's suggestion when I get home. PeterR
9. Re: open_dll problem
- Posted by peterR May 12, 2016
- 1721 views
Hi all Thanks for the suggestions. I'm at work now, but I'm thinking the "bittedness" idea makes most sense. I'll check out Irv's suggestion when I get home. PeterR
10. Re: open_dll problem
- Posted by peterR May 12, 2016
- 1743 views
Forgot to mention, system is OpenSuse Leap 42.1, xfce desktop (but other desktops are installed as well). PeterR
11. Re: open_dll problem
- Posted by peterR May 13, 2016
- 1701 views
OK, Irv was right. I had the stable version of OE installed, which I think only comes in 32-bit version. Replaced it with the unstable 64-bit version, and I can get Irv's gtk demos to run (yay!), but ... I also get console output like this (had to change double-dashes to single-dashes to make it format corectly):-
hostname: invalid option - 'I' Usage: hostname [-v] {hostname|-F file} set hostname (from file) domainname [-v] {nisdomain|-F file} set NIS domainname (from file) hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name hostname [-v] display hostname hostname -V|-version|-h|-help print info and exit dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y -s, --short short host name -a, --alias alias names -i, --ip-address addresses for the hostname -f, --fqdn, --long long host name (FQDN) -d, --domain DNS domain name -y, --yp, --nis NIS/YP domainname -F, --file read hostname or NIS domainname from given file This command can read or set the hostname or the NIS domainname. You can also read the DNS domain or the FQDN (fully qualified domain name). Unless you are using bind or NIS for host lookups you can change the FQDN (Fully Qualified Domain Name) and the DNS domain name (which is part of the FQDN) in the /etc/hosts file. hostname: Name or service not known ( t1.ex:2958): GLib-GObject-WARNING **: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
It doesn't appear on all demos. On some I just get the trailing deprecation warnings.
PeterR
Edit: You need to use the triple curly brackets {{{/}}} for preformatted text (e.g. code, console output). It looks like you were using triple square brackets [[[/]]] by mistake. -Greg
12. Re: open_dll problem
- Posted by irv May 13, 2016
- 1694 views
Apparently, not all hostname programs are created equal. Yuo can just comment out the line with hostname -I to disable auto detect for the network ip.
Only a few programs will be affected. I'll work on some other way to detect the IP.
The other warning I can't reproduce, although I remember seeing it in the past. Perhaps it is a warning that is enabled in only some GTK versions. Would be helpful to see what vers. of Eu, GTK, and EuGTK you have.
13. Re: open_dll problem
- Posted by irv May 13, 2016
- 1700 views
Might try replacing this part of inet_address function in GtkEngine.e:
------------------------------ export function inet_address() --------------------------------- object results object addr ifdef LINUX then sequence tmp = temp_file(,"MYIP-") system_exec(sprintf(`ifconfig | grep "inet addr:" > %s`,{tmp})) results = trim(read_file(tmp)) results = split(results," ") delete_file(tmp) --display(results) for i = 1 to length(results) do if match("inet addr:",results[i]) = 1 then addr = split(results[i],':') addr = addr[2] if not equal("127.0.0.1",addr) then return addr end if end if end for return "127.0.0.1" end ifdef
14. Re: open_dll problem
- Posted by peterR May 15, 2016
- 1610 views
The versions are now:-
EuGTK 4.11.7
Open Euphoria 4.1.0
libgtk-3.so.0.1600.7 (the file shown earlier was a symbolic link to this lib)
I'll have a go at your new code when I get a chance.
Peter R
15. Re: open_dll problem
- Posted by peterR May 19, 2016
- 1639 views
Hi Irv
I tried out the problem demos with your new EuGTK version and I no longer get the hostname error. I did at first get a "could not find ifconfig" error, but it was OK after I reset the path. Still got the deprecated warning.
ifconfig was in /sbin, which I would have thought should have been in my path already, so I suspect that this error was caused by my recent fiddling with the path to add the euphoria/bin directory.
PeterR
16. Re: open_dll problem
- Posted by jimcbrown (admin) May 19, 2016
- 1632 views
ifconfig was in /sbin, which I would have thought should have been in my path already
I've noticed that some distros do not include /sbin or /usr/sbin in the PATH by default for non-root users though. Not sure why this is the case.
17. Re: open_dll problem
- Posted by SDPringle May 19, 2016
- 1554 views
ifconfig was in /sbin, which I would have thought should have been in my path already
I've noticed that some distros do not include /sbin or /usr/sbin in the PATH by default for non-root users though. Not sure why this is the case.
Yes. This broke dsearch. The demo assumed certain paths were where dlls were located and that worked fine for some time because the paths were always the same. Now it parses ld.conf file.
S D Pringle