Página 1 de 1

HWGUI como compilar agora ?

Enviado: 18 Set 2026 17:27
por JoséQuintas
d:\github\hwgui>HBMK2 hwgui.hbp -w3 -es2 -m -n -strip -compr -workdir=c:\temp -q -Id:\fontes\util\build\
hbmk2: Processing environment options: -comp=mingw
hbmk2: Processing configuration: d:\harbour\bin\hbmk.hbc
Harbour 3.2.0dev (r2602281433)
Copyright (c) 1999-2025, https://harbour.github.io/
d:/github/hwgui/source/winapi/dialog.c:740:25: error: conflicting types for 's_ModalDlgProc'; have 'INT_PTR(struct HWND__ *, UINT, WPARAM, LPARAM)' {aka 'int(struct HWND__ *, unsigned int, unsigned int, long int)'}
740 | static INT_PTR CALLBACK s_ModalDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
| ^~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:29:25: note: previous declaration of 's_ModalDlgProc' with type 'LRESULT(struct HWND__ *, UINT, WPARAM, LPARAM)' {aka 'long int(struct HWND__ *, unsigned int, unsigned int, long int)'}
29 | static LRESULT CALLBACK s_ModalDlgProc( HWND, UINT, WPARAM, LPARAM );
| ^~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:799:25: error: conflicting types for 's_DlgProc'; have 'INT_PTR(struct HWND__ *, UINT, WPARAM, LPARAM)' {aka 'int(struct HWND__ *, unsigned int, unsigned int, long int)'}
799 | static INT_PTR CALLBACK s_DlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:30:25: note: previous declaration of 's_DlgProc' with type 'LRESULT(struct HWND__ *, UINT, WPARAM, LPARAM)' {aka 'long int(struct HWND__ *, unsigned int, unsigned int, long int)'}
30 | static LRESULT CALLBACK s_DlgProc( HWND, UINT, WPARAM, LPARAM );
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:907:25: error: conflicting types for 's_PSPProc'; have 'INT_PTR(struct HWND__ *, UINT, WPARAM, LPARAM)' {aka 'int(struct HWND__ *, unsigned int, unsigned int, long int)'}
907 | static INT_PTR CALLBACK s_PSPProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:31:25: note: previous declaration of 's_PSPProc' with type 'LRESULT(struct HWND__ *, UINT, WPARAM, LPARAM)' {aka 'long int(struct HWND__ *, unsigned int, unsigned int, long int)'}
31 | static LRESULT CALLBACK s_PSPProc( HWND, UINT, WPARAM, LPARAM );
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:1013:25: error: conflicting types for 's_PSPProcRelease'; have 'INT_PTR(struct HWND__ *, UINT, struct _PROPSHEETPAGEA *)' {aka 'int(struct HWND__ *, unsigned int, struct _PROPSHEETPAGEA *)'}
1013 | static INT_PTR CALLBACK s_PSPProcRelease( HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp )
| ^~~~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:32:25: note: previous declaration of 's_PSPProcRelease' with type 'LRESULT(struct HWND__ *, UINT, struct _PROPSHEETPAGEA *)' {aka 'long int(struct HWND__ *, unsigned int, struct _PROPSHEETPAGEA *)'}
32 | static LRESULT CALLBACK s_PSPProcRelease( HWND, UINT, LPPROPSHEETPAGE );
| ^~~~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:29:25: warning: 's_ModalDlgProc' used but never defined
29 | static LRESULT CALLBACK s_ModalDlgProc( HWND, UINT, WPARAM, LPARAM );
| ^~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:30:25: warning: 's_DlgProc' used but never defined
30 | static LRESULT CALLBACK s_DlgProc( HWND, UINT, WPARAM, LPARAM );
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:31:25: warning: 's_PSPProc' used but never defined
31 | static LRESULT CALLBACK s_PSPProc( HWND, UINT, WPARAM, LPARAM );
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:32:25: warning: 's_PSPProcRelease' used but never defined
32 | static LRESULT CALLBACK s_PSPProcRelease( HWND, UINT, LPPROPSHEETPAGE );
| ^~~~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:1013:25: warning: 's_PSPProcRelease' defined but not used [-Wunused-function]
1013 | static INT_PTR CALLBACK s_PSPProcRelease( HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp )
| ^~~~~~~~~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:907:25: warning: 's_PSPProc' defined but not used [-Wunused-function]
907 | static INT_PTR CALLBACK s_PSPProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:799:25: warning: 's_DlgProc' defined but not used [-Wunused-function]
799 | static INT_PTR CALLBACK s_DlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
| ^~~~~~~~~
d:/github/hwgui/source/winapi/dialog.c:740:25: warning: 's_ModalDlgProc' defined but not used [-Wunused-function]
740 | static INT_PTR CALLBACK s_ModalDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
| ^~~~~~~~~~~~~~
O que houve ?
Não compila mais do jeito tradicional ?
Não pode mais usar mingw de sempre ?

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 17:32
por JoséQuintas
testehwgui.png
testehwgui.png (146.11 KiB) Exibido 122 vezes
Já falhou windows.
ubuntu em andamento.

https://github.com/JoseQuintas/hwgui_fork/actions

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 17:37
por JoséQuintas
testhwgui.png
testhwgui.png (104.52 KiB) Exibido 121 vezes
É....
Nenhum dos dois compila...
Acho que ficou moderno demais.

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 17:43
por JoséQuintas
Em todas elas, o mesmo padrão: lá no topo do arquivo (linhas 29-32) as funções são declaradas (protótipo forward) como retornando LRESULT CALLBACK, mas mais adiante, onde são de fato definidas, retornam INT_PTR CALLBACK. No Win32 de 32 bits, LRESULT resolve pra long e INT_PTR resolve pra int — mesmo tamanho (4 bytes), mas tipos distintos em C. O GCC que você está usando (parece um MinGW mais novo) está tratando isso como erro de "tipos conflitantes" em vez de só warning, então a compilação para aí.

Importante: quem está certo aqui é a definição (INT_PTR) — desde que a Microsoft introduziu INT_PTR, é esse o tipo de retorno correto pra DialogProc/PropSheetPageProc (não LRESULT, que é pra WindowProc). Ou seja, os protótipos no topo do arquivo é que estão desatualizados/errados; provavelmente uma versão antiga de GCC/MinGW deixava passar essa inconsistência como warning, e o toolchain que você tem agora ficou mais rígido.

Correção: nas linhas 29-32 de d:\github\hwgui\source\winapi\dialog.c, trocar LRESULT CALLBACK por INT_PTR CALLBACK nas 4 declarações, deixando igual às definições. É uma mudança pequena e de baixo risco — só alinha o protótipo ao que a função já retorna de fato.

Se quiser, eu aplico direto — só preciso que você libere acesso à pasta d:\github\hwgui
Sei lá...
Atenção pra isto:
provavelmente uma versão antiga de GCC/MinGW deixava passar essa inconsistência como warning, e o toolchain que você tem agora ficou mais rígido.
Não estou usando nada mais moderno, só o mingw de sempre, sem CLANG, não sei se é isso que está sendo considerado mais moderno.
Se for..... melhor dar adeus a CLANG...
Mas como eu disse: NÃO SEI SE É ISSO

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 17:52
por JoséQuintas
Mesmo que fosse Clang, o erro apareceria igual — é um problema real no código-fonte do dialog.c (protótipo declarado como LRESULT CALLBACK nas linhas 29-32, mas definido como INT_PTR CALLBACK nas linhas 740/799/907/1013), não uma peculiaridade de um compilador específico. Qualquer compilador C que respeite tipos distintos entre long e int (mesmo do mesmo tamanho) vai acusar esse conflito. O que provavelmente mudou foi a versão do GCC/MinGW que você está usando agora ser mais rigorosa nisso do que a que você usava antes — não uma troca pra Clang.
Lembrando:
No ubuntu é o default, que deve ser mingw 16.x, no windows é mingw 15.x
Não sei qual está sendo usado aí nos testes.

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 18:54
por Itamar M. Lins Jr.
Olá!
Acredito que isso resolve rápido.
Tá usando ANSI e 32 bit ?
Qual é a versão desse gcc ?

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 19:03
por Itamar M. Lins Jr.
Olá!
Aguarde um momento, vou instalar seu ambiente aqui.
Parece que são poucas linhas para mudar.
Vou fazer os testes antes de mandar o commit.
source/winapi/dialog.c

Código: Selecionar todos

#define  WM_PSPNOTIFY         WM_USER+1010

static INT_PTR CALLBACK s_ModalDlgProc( HWND, UINT, WPARAM, LPARAM );
static INT_PTR CALLBACK s_DlgProc( HWND, UINT, WPARAM, LPARAM );
static INT_PTR CALLBACK s_PSPProc( HWND, UINT, WPARAM, LPARAM );
static INT_PTR CALLBACK s_PSPProcRelease( HWND, UINT, LPPROPSHEETPAGE );

#define	WND_DLG_RESOURCE       10
#define	WND_DLG_NORESOURCE     11

HWND *aDialogs = NULL;
static int s_nDialogs = 0;
int iDialogs = 0;

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 19:24
por Itamar M. Lins Jr.
Olá!
Teste novamente. Já fiz o commit.
A dialog.c, que eu me lembre isso é antigo. Não mudei isso.

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 19:29
por Itamar M. Lins Jr.
Olá!
Do ubuntu, não vai mesmo não. Ai é só para windows.
Remove essa pasta do make para ubuntu.
Ainda vou mexer na parte Linux, mas vai demorar. Primeiro é o Windows que tenho mais urgência.

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 21:17
por JoséQuintas
Os erros. Foram aqui.
Mas também deu erro no Github, os worflows de sempre, não olhei se foram os mesmos erros.
No windows é mingw 15.2.
No Ubuntu é o que vier.

Re: HWGUI como compilar agora ?

Enviado: 18 Set 2026 21:53
por Itamar M. Lins Jr.
Olá!
Eu não sei pq as IAs deixaram aquele código.
Até o CLAUDE, já tinha examinado o arquivo e não viu.
O que vi foi o arquivo dialog.c(windows) e a pasta \contrib\webview2(windows)
Nenhum desses é Ubuntu.
O make do ubuntu deve está varrendo a pasta contrib.
Devo colocar algum IFDEF lá para que ele ignore a pasta webview2 então.

Re: HWGUI como compilar agora ?

Enviado: 19 Set 2026 09:17
por JoséQuintas
Veja se acha interessante clonar hwgui pelo git e poder trabalhar no sourceforge/github ao mesmo tempo.
Já tem as compilações criadas, pra compilar a cada alteração.
Pode criar pra windows, linux, e outros.
Ou só salvar no github, só pra compilar.
É bom que ficam máquinas limpas, sem interferência de outras coisas que podem existir em nossas máquinas.
Meu clone faz isso, mas não atualizo sempre.

Re: HWGUI como compilar agora ?

Enviado: 19 Set 2026 15:12
por Itamar M. Lins Jr.
Olá!
Eu fiz isso, só não compilei por lá.
Vou fazer isso também.
Tenho 3 ou 4 cópias.
https://github.com/ItamarLins/HwguiSVN

Re: HWGUI como compilar agora ?

Enviado: 20 Set 2026 12:12
por Itamar M. Lins Jr.
Olá!
Outra coisa GCC 15 não é velho, é novo(praticamente)
Mas é uma versão aceita como atual.
Agora GCC 4,5,6 ai sim. Deixar compatível, com coisas mais antigas e perder recursos ? Temos que ponderar sobre isso.