"syntax check" vs "compile"

Just starting out? Need help? Post your questions and find answers here.
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

"syntax check" vs "compile"

Post 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
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: "syntax check" vs "compile"

Post by BarryG »

Hmm.
Last edited by BarryG on Mon Apr 29, 2024 11:26 am, edited 1 time in total.
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: "syntax check" vs "compile"

Post by Fred »

I think it should respect the executable format, it's basically a compiling without code generation
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: "syntax check" vs "compile"

Post 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
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: "syntax check" vs "compile"

Post by Fred »

My bad, all this is expected as syntax check behaves like compile/run. It's not like creating an executable.
Post Reply