1. open_dll problem

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

new topic     » topic index » view message » categorize

2. Re: open_dll problem

Hi Pete

You're probably more familiar with this stuff than me. Things to consider

  1. 64 bittedness - 32 bit eu and 64 bit so - need 32 bit libs and dependencies (nightmare)
  2. so location - sometimes doesn't like where it is - put a symlink to the library somewhere else
  3. 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!

new topic     » goto parent     » topic index » view message » categorize

3. Re: open_dll problem

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?

new topic     » goto parent     » topic index » view message » categorize

4. Re: open_dll problem

ChrisB said...

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: open_dll problem

irv said...

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: open_dll problem

http://askubuntu.com/questions/657881/firefox-42-libgtk-3-so-0-cannot-open-shared-object-file-no-such-file-or-dire

new topic     » goto parent     » topic index » view message » categorize

7. Re: open_dll problem

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

new topic     » goto parent     » topic index » view message » categorize

8. Re: open_dll problem

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

new topic     » goto parent     » topic index » view message » categorize

9. Re: open_dll problem

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

new topic     » goto parent     » topic index » view message » categorize

10. Re: open_dll problem

Forgot to mention, system is OpenSuse Leap 42.1, xfce desktop (but other desktops are installed as well). PeterR

new topic     » goto parent     » topic index » view message » categorize

11. Re: open_dll problem

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

new topic     » goto parent     » topic index » view message » categorize

12. Re: open_dll problem

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.

new topic     » goto parent     » topic index » view message » categorize

13. Re: open_dll problem

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 
new topic     » goto parent     » topic index » view message » categorize

14. Re: open_dll problem

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

new topic     » goto parent     » topic index » view message » categorize

15. Re: open_dll problem

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

new topic     » goto parent     » topic index » view message » categorize

16. Re: open_dll problem

peterR said...

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.

new topic     » goto parent     » topic index » view message » categorize

17. Re: open_dll problem

jimcbrown said...
peterR said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu