Compiler Directives
-
- User
- Posts: 34
- Joined: Mon Oct 01, 2018 7:10 pm
- Location: Winterport, Maine USA
Compiler Directives
When dealing with cross platform apps, It would be helpfull to have a complile driective like #Compile_Console
Re: Compiler Directives
Just searched the PureBasic help:
Reserved Constants
The PureBasic compiler has several reserved constants which can be useful to the programmer:
Code: Select all
#PB_Compiler_ExecutableFormat : Determines executable format. It can be one of the following: #PB_Compiler_Executable : Regular executable #PB_Compiler_Console : Console executable (have an effect only on Windows, other act like a regular executable) #PB_Compiler_DLL : Shared DLL (dynlib on MacOS X and shared object on Linux)
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
PB Last Final / Last Beta Testing
-
- User
- Posts: 34
- Joined: Mon Oct 01, 2018 7:10 pm
- Location: Winterport, Maine USA
Re: Compiler Directives
Thanks!
-
- User
- Posts: 34
- Joined: Mon Oct 01, 2018 7:10 pm
- Location: Winterport, Maine USA
Re: Compiler Directives
Nope, #PB_Compiler_Console = Syntax error Under Linux.
I will find a work around ..... but thanks for the responce.
I will find a work around ..... but thanks for the responce.
Re: Compiler Directives
The following code doesn't display any syntax error on my Lubuntu 18.04 with LXDE regardless if it is compiled with Executable Format "Linux" or "Console":Gary.Maine wrote:Nope, #PB_Compiler_Console = Syntax error Under Linux.
Code: Select all
CompilerSelect #PB_Compiler_ExecutableFormat
CompilerCase #PB_Compiler_Executable
MessageRequester("Info", "Executable format: Executable")
CompilerCase #PB_Compiler_Console
CompilerSelect #PB_Compiler_ExecutableFormat
CompilerCase #PB_Compiler_Executable
MessageRequester("Info", "Executable format: Executable")
CompilerCase #PB_Compiler_Console
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
OpenConsole("Executable format detection")
CompilerEndIf
PrintN("ExecutableFormat: Console")
PrintN("Press <Enter> to continue!")
Input()
CompilerCase #PB_Compiler_DLL
MessageRequester("Info", "Executable format: Library (.dll, .so or .dylib)")
CompilerEndSelect
CompilerCase #PB_Compiler_DLL
MessageRequester("Info", "Executable format: Library (.dll, .so or .dylib)")
CompilerEndSelect
[color=#0040FF][u]Help for Compiler Directives[/u][/color] wrote:#PB_Compiler_Console: Console executable (have an effect only on Windows, other act like a regular executable)