1. Need help GTK on Windows

Trying to get euGTK working on Windows. My system is:

  • Mint17 Virtualbox testing both XP and Win7
  • installed a "gtk bundle" to c:/gtk and the gtk3-demo works properly
  • euGTK 4.9.9
  • oE4.1.0 beta2 32bit

No visible GUI at all. There is a short pause and oE just quits. No message about not finding GTK files.

What do I do next?

_tom

new topic     » topic index » view message » categorize

2. Re: Need help GTK on Windows

_tom said...

Trying to get euGTK working on Windows. My system is:

  • Mint17 Virtualbox testing both XP and Win7
  • installed a "gtk bundle" to c:/gtk and the gtk3-demo works properly
  • euGTK 4.9.9
  • oE4.1.0 beta2 32bit

No visible GUI at all. There is a short pause and oE just quits. No message about not finding GTK files.

What do I do next?

_tom

wish there was a way to turn on trace from the commandline without needing to edit files. something like the -vv like python has which shows the files requested as they are requested by a program would help too. I don't think eui -TEST prog can tell you where a program with a silent exit fails either.

Process Explorer will show which files are requested and found or not found. you have to work with the filters to block out the many many other things going on. Depends will show you if there is a missing dependency with a dll and some other system or third party dll not found or not loadable.

not sure if Process Explorer can duplicate what Depends does, or if this is the same one as the dependency-walker. I still use REGMON, FILEMON and Depends from years ago and they still work fine.

Process Explorer https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Depends https://technet.microsoft.com/en-us/library/cc738370(v=ws.10).aspx

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

3. Re: Need help GTK on Windows

Using virtual Win7.

The process explorer simply shows that eui is active briefly then disappears.

I bound test1.ex (from the euGTK demos). Using depends.exe on this file I get

Warning: At least one delay-load dependency module was not found. 
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. 
 
--tom // eight files identified such as... 
 
API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL 
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL 
... 

This is now way past my tech level.

Is running Win7 in Oracle ~Virtualbox causing my problems?

Thanks,

_tom

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

4. Re: Need help GTK on Windows

As a sanity check I tested "iup4eu" (by Greg Haberek) on this virtual Win7 and the editor works.

_tom

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

5. Re: Need help GTK on Windows

_tom said...

Trying to get euGTK working on Windows. My system is:

  • Mint17 Virtualbox testing both XP and Win7
  • installed a "gtk bundle" to c:/gtk and the gtk3-demo works properly
  • euGTK 4.9.9
  • oE4.1.0 beta2 32bit

No visible GUI at all. There is a short pause and oE just quits. No message about not finding GTK files.

What do I do next?

_tom

Hallo

http://openeuphoria.org/forum/128480.wc?last_id=128563

Andreas

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

6. Re: Need help GTK on Windows

_tom said...

Using virtual Win7.

The process explorer simply shows that eui is active briefly then disappears.

I bound test1.ex (from the euGTK demos). Using depends.exe on this file I get

Warning: At least one delay-load dependency module was not found. 
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. 
 
--tom // eight files identified such as... 
 
API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL 
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL 
... 

This is now way past my tech level.

Is running Win7 in Oracle ~Virtualbox causing my problems?

Thanks,

_tom

the delay load and unresolved import are often false positives. you should be able to drag & drop a dll onto Depends and it will mark any actual missing dll files to let you know if GTK can't find something it needs.

Microsoft some years ago merged REGMON and FILEMON into the Process Explorer. there should be menu options to monitor the registry or file access so you will know which directories eui searches through and which files it finds or can't find. the file access should do it. I think windows GTK depends on dll being installed on the path somewhere relative to the main dll files, rather than the registry.

sorry, I don't have Process Explorer installed at the moment. file monitor should be fairly easy to find in the menu somewhere. this should give you an idea how far eui is getting. could just be a path or permission problem too.

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

7. Re: Need help GTK on Windows

andi49 said...
_tom said...

Trying to get euGTK working on Windows. My system is:

  • Mint17 Virtualbox testing both XP and Win7
  • installed a "gtk bundle" to c:/gtk and the gtk3-demo works properly
  • euGTK 4.9.9
  • oE4.1.0 beta2 32bit

No visible GUI at all. There is a short pause and oE just quits. No message about not finding GTK files.

What do I do next?

_tom

Hallo

http://openeuphoria.org/forum/128480.wc?last_id=128563

Andreas

Or, for a message view, see andi49's post at http://openeuphoria.org/forum/m/128484.wc

In short, it looks like EuGTK needs to have some plus signs added to switch over to cdecl calls (instead of stdcall).

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

8. Re: Need help GTK on Windows

Danke!

I was fooled by the euphoriagtk home page which currently states:

""" New with version 4.9.0: I have tested this with Windows 7 and the 64-bit version of the Gtk libraries for
Windows. Sorry, I do not have a 32-bit Windows installation to test. It works well, with only a few relatively
minor glitches, related to use of theme icons and locale. Euphoria programs running on Windows have the
Windows native look and feel (translucent titlebars, etc). """

jimcbrown said...

Or, for a message view, see andi49's post at http://openeuphoria.org/forum/m/128484.wc

In short, it looks like EuGTK needs to have some plus signs added to switch over to cdecl calls (instead of stdcall).

Success!

I added two lines to the GtkEngine.e, and now I get demos to work. That is with a virtual Windows XP as a window on Linux.

Irv, try this fix please.

My conclusion (for a non Windows user) is that with a "gtk bundle" it is simple to add the needed files for Windows. Gtk can now be considered to be a cross-platform GUI for Euphoria.

_tom

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

9. Re: Need help GTK on Windows

Since EuGTK works ok on my native Win 7, 64 bit, without the '+' what ifdefs should i use when adding this? Without ifdef, + breaks Linux.

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

10. Re: Need help GTK on Windows

irv said...

Since EuGTK works ok on my native Win 7, 64 bit, without the '+' what ifdefs should i use when adding this? Without ifdef, + breaks Linux.

include std/console.e 
ifdef BITS64 or LINUX then 
	-- do the cdecl or new 64bit calling stuff 
	puts(1,"linux or win64\n") 
elsifdef EU4_0 and WINDOWS then 
		-- do Windows stdcall stuff 
		puts(1,"windows32 and eu4.0\n") 
elsifdef	BITS32 and WINDOWS then 
		-- also do windows stdcall stuff 
		puts(1,"windows32 and eu4.1\n") 
end ifdef 
 
any_key() 

maybe something like this above.

Andreas

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

11. Re: Need help GTK on Windows

irv said...

Without ifdef, + breaks Linux.

It does? I've never run into this problem. I am pretty sure it just ignores the + and always uses cdecl on Linux.

-Greg

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

12. Re: Need help GTK on Windows

It is supposed to ignore the + on Linux. Here is what I would do:

include std/console.e 
ifdef BITS32 and WINDOWS then  
    constant convention = "+" 
else 
    constant convention = "" 
end ifdef 

Then you use 'convention' in your routine you probably wrote that in turn calls define_c_proc or define_c_func.

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

13. Re: Need help GTK on Windows

use like this;

constant cfunction = define_c_func(convention & foo, argtypes, rettype) 
new topic     » goto parent     » topic index » view message » categorize

14. Re: Need help GTK on Windows

SDPringle said...

It is supposed to ignore the + on Linux.

And it very well does. So I don't see how any of that is at all necessary. On Linux there is only one calling convention: CDECL.

  • If you include "+" on Windows, you're forcing the calling convention from STDCALL to CDECL.

  • If you include "+" on Linux, you're forcing the calling convention from CDECL to CDECL.

Either way, the "+" gets stripped from the function name before being looked up via GetProcAddress or dlsym.

Here are the relevant code snippits from be_machine.c in the DefineC function.

... 
 
#ifdef EWINDOWS 
    /* On Windows we normally expect routines to restore the stack when they return. */ 
    convention = C_STDCALL; 
#else 
    /* On Unix like Operating Systems the caller must always restore the stack */ 
    convention = C_CDECL; 
#endif 
 
... 
 
    /* C .dll routine */ 
    if (IS_ATOM(routine_name)) 
        RTFatal("routine name must be a sequence"); 
    routine_ptr = SEQ_PTR(routine_name); 
    Ref(routine_name); 
    if (routine_ptr->length >= TEMP_SIZE) 
        RTFatal("routine name is too long"); 
    routine_string = TempBuff; 
    MakeCString(routine_string, routine_name, TEMP_SIZE); 
    if (routine_string[0] == '+') { 
        routine_string++; 
        convention = C_CDECL; 
    } 
#ifdef EWINDOWS 
    proc_address = (intptr_t (*)())GetProcAddress((void *)lib, routine_string); 
    if (proc_address == NULL) 
        return ATOM_M1; 
#else 
    proc_address = (intptr_t (*)())dlsym((void *)lib, routine_string); 
    if (dlerror() != NULL) 
        return ATOM_M1; 
#endif 
 
... 
 
    c_routine[c_routine_next].address = proc_address; 
    c_routine[c_routine_next].name = routine_ptr; 
    c_routine[c_routine_next].arg_size = SEQ_PTR(arg_size); 
    c_routine[c_routine_next].return_size = t; 
    c_routine[c_routine_next].convention = convention; 
 
... 

-Greg

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

15. Re: Need help GTK on Windows

C routines on 64-bit platform are called in a special way involving using the 64-bit processor's registers for passing the parameters. The only place where the '+' really matters on Windows 32-bit.

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

16. Re: Need help GTK on Windows

Strangely, the some comments we left here are gone. Basically, we looked at the source and found the + sign was ignored on Linux and 64-bit platforms, which means only Windows 32-bit, which uses stdcall by default, is affected by a '+' before the routine name. It shouldn't hurt to leave plus signs before the routine names.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu