Hi Charles,
the more I learn about freebasic, the more I get impressed by the options of this compiler. I used the options -v, -C and -R to create oxygen.dll in \inc\OXFBSRC
go3.bat:
set compile=d:\programme\fbwin32\fbc
:: use copy of \tools\OxyDateTimeStamper.exe
OxyDateTimeStamper.exe
%compile% -v -C -R -dll oxygen.bas
::upx --brute oxygen.dll
::copy oxygen.dll OxygenBasic
pause
It is interesting to see what happens and that the created files can be preserved. The (formatted) output in my console is:
D:\OxygenBasic\inc\OXFBSRC>d:\programme\fbwin32\fbc -v -C -R -dll oxygen.bas
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target: win32, 486, 32bit
compiling: oxygen.bas -o oxygen.asm (main module)
assembling: d:\programme\fbwin32\bin\win32\as.exe --32 --strip-local-absolute "oxygen.asm" -o "oxygen.o"
linking: d:\programme\fbwin32\bin\win32\ld.exe -m i386pe -o "oxygen.dll" -subsystem console --dll
-enable-stdcall-fixup -e _DllMainCRTStartup@12 "d:\programme\fbwin32\lib\win32\fbextra.x"
--stack 1048576,1048576 --output-def "oxygen.def" -s
-L "d:\programme\fbwin32\lib\win32" -L "." "d:\programme\fbwin32\lib\win32\dllcrt2.o"
"d:\programme\fbwin32\lib\win32\crtbegin.o" "d:\programme\fbwin32\lib\win32\fbrt0.o"
"oxygen.o"
"-(" -lkernel32 -loleaut32 -luser32 -lfb -lgcc -lmsvcrt -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)"
"d:\programme\fbwin32\lib\win32\crtend.o"
creating import library: d:\programme\fbwin32\bin\win32\dlltool.exe --def "oxygen.def"
--dllname "oxygen.dll" --output-lib "liboxygen.dll.a"
Oxygen.dll created with Freebasic has a very good reputation with AV-Scanners. (0/70). The reputation of oxygen.dll created in \inc\OXSC is not so good. I looked for differences and noticed these:
Oxygen (fbc):
File type Win32 DLL
Magic PE32 executable for MS Windows (DLL) (console) Intel 80386 32-bit
EntryPoint 0x1410
ImageFileCharacteristics Executable, No line numbers, No symbols, 32-bit, No debug, DLL
PEType PE32
Subsystem Windows command line
Oxygen (O2)
File type Win32 DLL
Magic PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit
EntryPoint 0x1000
ImageFileCharacteristics Executable, 32-bit, DLL
Subsystem Windows GUI
SubsystemVersion 4.0
fbc creates a console executable, O2 seems not to do this. Could this be a reason for the different behaviour of AV-Scanners?
In theory it should be possible to create an object file of \inc\OXSC\BuildOxygenDLL.o2bas too? But I must admit that I would have no idea what libs could be used to link against this (theoretical) object file.
Roland