Page 1 of 1

"syntax check" vs "compile"

Posted: Mon Apr 29, 2024 2:24 am
by jassing
This seems like a bug-- "syntax check" assumes you are compiling an exe
ie: "syntax check" ignores "; ExecutableFormat = Shared dll"
or is this expected?

Help file "Compiling your programs" does not even mention "syntax check" - (btw: the 2nd graphic seems a bit wonky, see below)

(This code should be copied, and saved (ie: notepad) before opening in the IDE.)

Code: Select all

CompilerIf #PB_Compiler_ExecutableFormat <> #PB_Compiler_DLL 
  CompilerWarning("Compiling - NOT a dll")
  Import "test.lib"
    abcxyz(a)  
  EndImport
CompilerElse
  CompilerWarning("Compiling - IS a dll")  
CompilerEndIf

;---- FROM ftpSupport.pbi

ProcedureDLL abcxyz(a)
  ProcedureReturn a+1
EndProcedure


; IDE Options = PureBasic 6.10 LTS (Windows - x64)
; ExecutableFormat = Shared dll
; CursorPosition = 12
; Folding = -
; Optimizer
; EnableThread
; EnableXP
; Executable = test.dll
; Compiler = PureBasic 6.10 LTS - C Backend (Windows - x64)
; EnablePurifier
; EnableCompileCount = 1
; EnableBuildCount = 1
; EnableExeConstant
Wonky graphic:
Image

Re: "syntax check" vs "compile"

Posted: Mon Apr 29, 2024 8:25 am
by BarryG
Hmm.

Re: "syntax check" vs "compile"

Posted: Mon Apr 29, 2024 8:36 am
by Fred
I think it should respect the executable format, it's basically a compiling without code generation

Re: "syntax check" vs "compile"

Posted: Sun May 12, 2024 5:08 pm
by jassing
Fred wrote: Mon Apr 29, 2024 8:36 am I think it should respect the executable format, it's basically a compiling without code generation
Another example -- set compiler to asm, syntax check - all ok; set it to C, all ok.

Code: Select all

EnableExplicit

Define test.i
CompilerIf #PB_Compiler_Backend=#PB_Backend_Asm
  test+1
CompilerElse
  ! test+1;
CompilerEndIf

Re: "syntax check" vs "compile"

Posted: Wed May 15, 2024 10:33 am
by Fred
My bad, all this is expected as syntax check behaves like compile/run. It's not like creating an executable.