Recent

Author Topic: Problem with gtk3 when compile empty app  (Read 1164 times)

megatron

  • Newbie
  • Posts: 2
Problem with gtk3 when compile empty app
« on: June 30, 2020, 08:43:30 pm »
Problem with gtk3 when compile empty app
« Last Edit: June 30, 2020, 08:52:56 pm by megatron »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8614
  • FPC developer.
Re: Problem with gtk3 when compile empty app
« Reply #1 on: June 30, 2020, 11:32:38 pm »
On Windows, afaik IUNknown is stdcall. So this probably never has been used on windows.

dbannon

  • Hero Member
  • *****
  • Posts: 1113
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #2 on: July 01, 2020, 02:22:47 am »
Are you cross compiling or  trying to build a gtk3 windows app ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

PascalDragon

  • Hero Member
  • *****
  • Posts: 1967
  • Compiler Developer
Re: Problem with gtk3 when compile empty app
« Reply #3 on: July 01, 2020, 09:20:10 am »
On Windows, afaik IUNknown is stdcall. So this probably never has been used on windows.

It would be enough to remove the calling conventions from the implementation. It's correct in the interface part of TGtk3Widget. Probably using Code Completion let to the addition of only the cdecl in the implementation.

megatron

  • Newbie
  • Posts: 2
Re: Problem with gtk3 when compile empty app
« Reply #4 on: July 01, 2020, 12:40:13 pm »
Are you cross compiling or  trying to build a gtk3 windows app ?

Davo


trying build a gtk 3 window app only

i work with gtk2 without any problem

but i am try to build app with gtk3

m.abudrais

  • Jr. Member
  • **
  • Posts: 51
Re: Problem with gtk3 when compile empty app
« Reply #5 on: July 01, 2020, 02:38:06 pm »
why do you need gtk in windows?

Thaddy

  • Hero Member
  • *****
  • Posts: 10294
Re: Problem with gtk3 when compile empty app
« Reply #6 on: July 01, 2020, 02:52:07 pm »
why do you need gtk in windows?
Whereas it it usually recommended to use the default look for the OS, it can be the case that one wants to have the same look across all platforms. (E.g. games, sometimes corporate, etc)
This is not uncommon.
« Last Edit: July 01, 2020, 02:55:33 pm by Thaddy »
I am more like donkey than shrek

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8614
  • FPC developer.
Re: Problem with gtk3 when compile empty app
« Reply #7 on: July 01, 2020, 02:59:12 pm »
why do you need gtk in windows?
Whereas it it usually recommended to use the default look for the OS, it can be the case that one wants to have the same look across all platforms. (E.g. games, sometimes corporate, etc)
This is not uncommon.

Apparently it is, if this is the first time it is compiled on Windows :-) The GTK3 port is half a decade old.

Thaddy

  • Hero Member
  • *****
  • Posts: 10294
Re: Problem with gtk3 when compile empty app
« Reply #8 on: July 01, 2020, 03:00:09 pm »
It would be enough to remove the calling conventions from the implementation. It's correct in the interface part of TGtk3Widget. Probably using Code Completion let to the addition of only the cdecl in the implementation.
One could use winapi instead of a specific convention, since that chooses the right calling convention for a platform and works not just on windows. Assumes 3.2.0 or higher.
I am more like donkey than shrek

Thaddy

  • Hero Member
  • *****
  • Posts: 10294
Re: Problem with gtk3 when compile empty app
« Reply #9 on: July 01, 2020, 03:04:12 pm »
Apparently it is, if this is the first time it is compiled on Windows :-) The GTK3 port is half a decade old.
I never used GTK3, but there are many GTK2 applications available on Windows for the reasons I mentioned.
(isn't Blender one of those? and how about the mingw interface? Just to name two)

The point I try to make is not related to GTK3, but to any portable widgetset.
 
« Last Edit: July 01, 2020, 03:08:02 pm by Thaddy »
I am more like donkey than shrek

PascalDragon

  • Hero Member
  • *****
  • Posts: 1967
  • Compiler Developer
Re: Problem with gtk3 when compile empty app
« Reply #10 on: July 01, 2020, 09:59:53 pm »
It would be enough to remove the calling conventions from the implementation. It's correct in the interface part of TGtk3Widget. Probably using Code Completion let to the addition of only the cdecl in the implementation.
One could use winapi instead of a specific convention, since that chooses the right calling convention for a platform and works not just on windows. Assumes 3.2.0 or higher.

The code is older than 3.2.0 and Lazarus supports the last two releases. Also the IInterface methods are declared the same way and one likely will simply copy these to implement them.

dbannon

  • Hero Member
  • *****
  • Posts: 1113
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #11 on: July 02, 2020, 03:17:36 am »
But seriously, why use GTK3 on Windows ?

GTK3 on Linux has a long way to go, my guess is its far worse on Windows ?  megatron, perhaps you are not aware of the usual way to make cross platform apps ?   if you leave the default setting in place, Lazarus will use the local default widgetset, so, on Linux it will use GTK2 (which is pretty good, stable, widely supported) and on Windows will use the Win32 widgetset, again, just what you want on Windows.

If you want to help track down the GTK3 issues (and more power to your strong right arm) then you would find Linux a much friendly place to do so.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8614
  • FPC developer.
Re: Problem with gtk3 when compile empty app
« Reply #12 on: July 02, 2020, 11:14:26 am »
Apparently it is, if this is the first time it is compiled on Windows :-) The GTK3 port is half a decade old.
I never used GTK3, but there are many GTK2 applications available on Windows for the reasons I mentioned.

Gtk3widgets is in the lcl\interfaces\gtk3 dir. We are talking about the Lazarus GTK3 interface here, not about a hypothetical GTK3-only application.

And there is not much reason  to use that on Windows, since a proper Lazarus win32 interface is available, which is evident since it doesn't even compile.

Quote
The point I try to make is not related to GTK3, but to any portable widgetset.

Most of those applications have gtk on Windows because they are hardcoded to GTK and thus are condemned to it. It is not a choice but a result of the lack of choice.

Thaddy

  • Hero Member
  • *****
  • Posts: 10294
Re: Problem with gtk3 when compile empty app
« Reply #13 on: July 02, 2020, 01:04:03 pm »
Most of those applications have gtk on Windows because they are hardcoded to GTK and thus are condemned to it. It is not a choice but a result of the lack of choice.
So we agree?  ;D
I am more like donkey than shrek

 

TinyPortal © 2005-2018