Bug with #PB_Compiler_ExecutableFormat ???

Everything else that doesn't fall into one of the other PB categories.
Gérard
User
User
Posts: 48
Joined: Sat Oct 17, 2015 6:00 pm
Location: France
Contact:

Bug with #PB_Compiler_ExecutableFormat ???

Post by Gérard »

Hello,
Can you check if by modifying the menu Compiler/Compiler Options.../Executable format: with the 3 possible values, there is indeed a bug with the Shared Dll option
The Windows and Console options do return the correct value for #PB_Compiler_ExecutableFormat, but the Shared Dll option returns the same value as the Windows option.

;Values ​​of the 3 options:
#PB_Compiler_Executable = 0
#PB_Compiler_DLL = 1
#PB_Compiler_Console = 2

;Values ​​returned by #PB_Compiler_ExecutableFormat
;0 if Windows option
;0 if Shared Dll option ---> Should be 1 (Bug?)
;2 if Console option

Thanks for trying,
Gérard

Test code:

Code: Select all

CompilerSelect #PB_Compiler_ExecutableFormat
  CompilerCase #PB_Compiler_Executable ; 0
    CompilerError "Option Windows : "    +#PB_Compiler_ExecutableFormat
    
  CompilerCase #PB_Compiler_DLL        ; 1
    CompilerError "Option Shared Dll : "+#PB_Compiler_ExecutableFormat
    
 CompilerCase #PB_Compiler_Console     ; 2
    CompilerError "Option Console : "   +#PB_Compiler_ExecutableFormat
    
 [CompilerDefault]
    CompilerError "Option autre : "     +#PB_Compiler_ExecutableFormat
CompilerEndSelect
■ Win10 64-bit (Intel Celeron CPU N2920 @ 1.86GHz, 4,0GB RAM, Intel HD Graphics) & PB 6.00 LTS
■ Vivre et laisser vivre.
■ PureBasic pour le fun
■ cage sur le forum Français
■ Mes sites: http://pbcage.free.fr - http://yh.toolbox.free.fr
nsstudios
Enthusiast
Enthusiast
Posts: 309
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

Re: Bug with #PB_Compiler_ExecutableFormat ???

Post by nsstudios »

Edit: the following report was done using the run/compile option, the code was not actually properly compiled.
If it is a bug, I can confirm getting the behavior starting from 5.73 final up to (and including) 6.03 beta 5; in all of those versions, #pb_compiler_executableFormat returns #pb_compiler_executable both when windows and shared dll is selected in compiler options.
Couldn't easily test even older versions.
Last edited by nsstudios on Tue Aug 29, 2023 11:33 am, edited 1 time in total.
juergenkulow
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 25, 2019 10:18 am

Re: Bug with #PB_Compiler_ExecutableFormat ???

Post by juergenkulow »

Code: Select all

PureBasic 6.02 LTS - C Backend (Linux - x64)
Loading external modules...
Loading 'c' subsystem
Starting compilation...
Starting compilation...
Error: Line 5 - Option Shared Dll : 1
/media/ramdisk/pb602/purebasic/compilers/pbcompilerc Runtime:43 ms
Errorcode: 1

PureBasic 6.02 LTS (Linux - x64)
Loading external modules...
Starting compilation...
Starting compilation...
Error: Line 5 - Option Shared Dll : 1
/media/ramdisk/pb602/purebasic/compilers/pbcompiler Runtime:60 ms
Errorcode: 1

Code: Select all

PureBasic 6.03 beta 5 LTS - C Backend (Windows - x86)
Loading 'C' subsystem
Compiling D:\eform.pb
Loading external libraries...
Starting compilation...
Error: Line 5 - Option Shared Dll : 1
H:\OldPB\PureBasic\603Beta5x86\Compilers\pbcompilerc.exe Runtime:158 ms
Errorcode: 1

PureBasic 6.03 beta 5 LTS (Windows - x86)
Compiling D:\eform.pb
Loading external libraries...
Starting compilation...
Error: Line 5 - Option Shared Dll : 1
H:\OldPB\PureBasic\603Beta5x86\Compilers\pbcompiler.exe Runtime:194 ms
Errorcode: 1
With the command line and with IDE Compiler Executable everything runs correctly.
Gérard
User
User
Posts: 48
Joined: Sat Oct 17, 2015 6:00 pm
Location: France
Contact:

Re: Bug with #PB_Compiler_ExecutableFormat ???

Post by Gérard »

Thanks for the confirmation, maybe Fred can fix this in the next version of PB

Gérard
■ Win10 64-bit (Intel Celeron CPU N2920 @ 1.86GHz, 4,0GB RAM, Intel HD Graphics) & PB 6.00 LTS
■ Vivre et laisser vivre.
■ PureBasic pour le fun
■ cage sur le forum Français
■ Mes sites: http://pbcage.free.fr - http://yh.toolbox.free.fr
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Bug with #PB_Compiler_ExecutableFormat ???

Post by STARGÅTE »

No problem here (PB 6.01 LTS).

Depending on the selected option in the settings, it gives me 0, 1 or 2 during compilation.

Hint: You have to create the compilation actually. Just pressing "compile/run", always creates an executable (and no DLL), because you can not "run" a DLL.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
nsstudios
Enthusiast
Enthusiast
Posts: 309
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

Re: Bug with #PB_Compiler_ExecutableFormat ???

Post by nsstudios »

STARGÅTE wrote: Tue Aug 29, 2023 11:17 am Hint: You have to create the compilation actually. Just pressing "compile/run", always creates an executable.
I was just using the compile/run option, so that explains it.
I don't think I'm the only one who expected the executable that gets generated in order to let you test the dll without compiling the actual dll and having to call it from somewhere would set its flag to dll executable format, too, so that the check for executable format could also be properly tested; if I am, I'm sorry, also doubly sorry for contributing bad data/making things confusing if the original question/report was doing it correctly.
Post Reply