Page 1 of 1

PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Tue Nov 11, 2025 9:50 am
by PeDe
I use PB v6.30 beta versions with Raspberry Pi OS (Debian 13, Trixie, arm64) without any problems.
Now I wanted to use PB v6.21, but when running code in the IDE, I always get an error message.

Code: Select all

MessageRequester("Test", "Test")

;PureBasic - Assembler error
;error: implicit declaration of function 'PB_FreeGtkBase' [-Wimplicit-function-declaration]
; 341 | PB_FreeGtkBase();
Is PB v6.21 no longer compatible with Trixie?

Peter

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Tue Nov 11, 2025 2:16 pm
by Fred
May be it was a bug fixed in 6.30. We didn't changed the build system for 6.30, it still build on raspberry debian 12, so it shouldn't have any impacts between 6.21 and 6.30

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Tue Nov 11, 2025 7:13 pm
by mk-soft
I have also installed Debian 13 (Trixie) for ARM64 on my Raspberry PI5 desktop.
PB v6.21 and PB v6.30

It works for me.

Perhaps not all required developer packages are installed. Simple Install of PureBasic ...

The WebGadget or WebViewGadget is currently not working because we need different versions of PureBasic v6.30 for Debian 12 (libwebkit2gtk-4.0-dev) and Debian 13 (libwebkit2gtk-4.1-dev).

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Tue Nov 11, 2025 8:32 pm
by PeDe
I installed everything that is possible and available according to the instructions. This did not change the error message.
I have the ‘Raspberry Pi OS Full’ version, but have not installed any other programs except Grsync and Gpartet.

Peter

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Wed Nov 12, 2025 6:50 am
by PeDe
When I disable the compiler option ‘Create threadsave executable’, I can run the code in the IDE. With the option enabled, I get the error message.

Peter

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Wed Nov 12, 2025 7:29 pm
by mk-soft
Stimmt.

PB v6.21:
Bug Linux C-backend Intel and ARM with ThreadSafe in PB_EndFunctions

Code: Select all

/ 
void PB_EndFunctions() {
PB_Event_Free();
PB_FreeGtkBase(); // <--- Must be PB_FreeGtkBase_THREAD();
PB_FreeObjects();
PB_FreeMemorys();
}
// 
Fixed in PB v6.30

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Wed Nov 12, 2025 9:21 pm
by mk-soft
Bugfix for PB v6.21 Linux C-Backend and ThreadSafe.

Code: Select all

;-TOP by mk-soft, v1.01.1, 12.11.2025

; PB v6.21 (Debian 13) Fix C-Backend PB_FreeGtkBase over C-Macro
CompilerIf #PB_Compiler_OS = #PB_OS_Linux And #PB_Compiler_Version = 621
  CompilerIf #PB_Compiler_Thread And #PB_Compiler_Backend = #PB_Backend_C
    Procedure FixFreeGtkBaseThread()
      !#define PB_FreeGtkBase() PB_FreeGtkBase_THREAD()
    EndProcedure : FixFreeGtkBaseThread()
  CompilerEndIf
CompilerEndIf

MessageRequester("Test", "Test")

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Thu Nov 13, 2025 6:54 am
by PeDe
Thanks, that works.
But why does ‘!#define...’ have to be in a procedure? And is the call there so that the procedure isn't optimized away?

Peter

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Thu Nov 13, 2025 9:58 am
by mk-soft
PeDe wrote: Thu Nov 13, 2025 6:54 am Thanks, that works.
But why does ‘!#define...’ have to be in a procedure? And is the call there so that the procedure isn't optimized away?

Peter
It was a little tricky to ensure that the C macro was defined before PB_EndFunctions. Therefore, it was implemented as a procedure.
The call is really there to prevent it from being optimised away.
;)

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Thu Nov 13, 2025 10:51 am
by Fred
This should work, I don't think the procedure is needed here

Code: Select all

; PB v6.21 (Debian 13) Fix C-Backend PB_FreeGtkBase over C-Macro
CompilerIf #PB_Compiler_OS = #PB_OS_Linux And #PB_Compiler_Version = 621
  CompilerIf #PB_Compiler_Thread And #PB_Compiler_Backend = #PB_Backend_C
      !#define PB_FreeGtkBase PB_FreeGtkBase_THREAD
  CompilerEndIf
CompilerEndIf

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Thu Nov 13, 2025 10:59 am
by PeDe
No, without the procedure, the error occurs again.

Peter

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Thu Nov 13, 2025 11:17 am
by mk-soft
Hallo Fred,
The C macro is otherwise only defined after PB_EndFunctions. As a procedure beforehand.
See "purebasic.c" file ;)

Re: PBv6.21 arm64 Trixie - Assembler error 'PB_FreeGtkBase'

Posted: Thu Nov 13, 2025 1:32 pm
by Fred
I see ! Or use HeaderSection from 6.30 :lol: