Re: Phix DLL dependency issue

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi Pete

Thanks for the changes. After making them and one extra change to iup_init1() it worked fine (with win32 empty).
Following a bit of rationalisation (sorry, can't help myself) open_dll() ended up looking like this...

function iup_open_dll(sequence libs) 
string path = libs[libidx] 
 
    if platform()=WINDOWS then 
        if dll_path != "" and chdir(dll_path)=0 then ?9/0 end if 
    elsif platform()=LINUX then 
--      for now, see demo/pGUI/lnx/installation.txt... 
--      path = dll_path&path 
    end if 
 
    atom res = open_dll(path) 
    if res=0 then iup_link_error(path) end if 
    return res 
end function 

The start of iup_init1() ends up like this (without comment blocks and bindings) ...

procedure iup_init1(nullable_string dll_root) 
    sequence s = include_paths() 
    string dll_dir = sprintf("%s%d",{dirs[libidx],machine_bits()}) 
    for i=1 to length(s) do 
        sequence sip = split_path(s[i]) 
        if sip[$]="pGUI" then 
            sip = append(sip,dll_dir) 
            dll_path = join_path(sip,trailsep:=1) 
 
            if get_file_type(dll_path)=FILETYPE_DIRECTORY then 
                s = {} 
                exit 
            end if 
        end if 
    end for 
    if s!={} then 
        -- allow pGUI in the app dir, with a win/lnx,32/64 sub-dir: 
        for i=1 to length(s) do 
            string dll_path = join_path({s[i],dll_dir}) 
            if get_file_type(dll_path)=FILETYPE_DIRECTORY then 
                s = {} 
                exit 
            end if 
        end for 
    end if 
    if s!={} then 
        string dll_path = join_path({dll_root,dll_dir}) 
        if get_file_type(dll_path)=FILETYPE_DIRECTORY then 
            s = {} 
        end if 
    end if 
 
-- LES: Code changed here 
    dll_path = "" 
 
--DEV: 
    if platform()=WINDOWS then 
        string curr_dir = current_dir() 
 
-- LES: I added the first test in next line 
        if dll_path != "" and chdir(dll_path)=0 then ?9/0 end if 
         
        if open_dll("msvcr120.dll")=0 then 
            puts(1,"fatal error: msvcr120.dll could not be loaded\n") 
            puts(1," try installing Visual C++ Redistributable Packages for Visual Studio 2013\n") 
            puts(1," from https://www.microsoft.com/en-us/download/details.aspx?id=40784 \n") 
            -- ( https://www.microsoft.com/en-us/download/details.aspx?id=40784 ) 
            {} = wait_key() 
            ?9/0 
        end if 
        if chdir(curr_dir)=0 then ?9/0 end if 
    end if 

Les

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu