I'm trying to run the simplest stock Wingraph application (Hello.pas). (See Wingraph info -
http://math.ubbcluj.ro/~sberinde/wingraph/)
// Hello world program
program hello;
{$APPTYPE GUI}
uses wingraph;
var mess : string;
gd,gm : smallint;
errcode: smallint;
begin
gd:=Detect;
InitGraph(gd,gm,'');
errcode:=GraphResult;
if (errcode = grOK) then
begin
mess:='Hello world by WinGraph';
OutTextXY((GetMaxX-TextWidth (mess)) div 2,
(GetMaxY-TextHeight(mess)) div 2,mess);
repeat until CloseGraphRequest;
CloseGraph;
end;
end.
The following is at the beginning of Wingraph.pas which stops compilation ("wingraph.pas(16,4) Fatal: User defined: This unit must be compiled under Win32") -
unit wingraph;
{$IFNDEF WIN32}
{$FATAL This unit must be compiled under Win32} // Compiler stops here
{$ENDIF}
In \Project\Project options\Config and Target, "Win32 GUI application is checked". Underneath that is the message "Current LCL widgetset: win32".
I can force compilation by defining Win32 -
{$define WIN32} // new define
unit wingraph;
{$IFNDEF WIN32}
{$FATAL This unit must be compiled under Win32} // Compiled OK now
{$ENDIF}
However, I don't think this is what the code author intended.
What should I do to get around the above compiler problem without artificially inserting the WIN32 define?
Note: This will be a console program that will only run under Windows.
Lazarus 1.6, FPC 3.0.0
Thanks,
Don C.