Lazarus compilation error for lesson 1

Examples step by step how to make your own automated strategy or user indicator
Message
Author
jimbo
Posts: 2
Joined: Sat Jan 25, 2014 9:36 am

Lazarus compilation error for lesson 1

#1 Postby jimbo » Mon Mar 17, 2014 3:12 am

Hi, I can't figure out why I am getting the following errors related to the library StrategyInterfaceUnit.pas.

Using Lazarus 1.2RC2. x86_64-win64-win32/win64.

Since the library source can't be wrong, it's gotta be some setting in Lazarus that I got wrong right?

Code: Select all

StrategyInterfaceUnit.pas(913,67) Hint: Function result variable does not seem to be initialized
StrategyInterfaceUnit.pas(923,66) Hint: Function result variable does not seem to be initialized
StrategyInterfaceUnit.pas(992,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(998,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1004,26) Error: Incompatible types: got "<procedure variable type of function:^Char of object;StdCall>" expected "AnsiString"
StrategyInterfaceUnit.pas(1010,26) Error: Incompatible types: got "<procedure variable type of function:LongInt of object;StdCall>" expected "LongInt"
StrategyInterfaceUnit.pas(1016,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1100,13) Warning: Conversion between ordinals and pointers is not portable
StrategyInterfaceUnit.pas(1169,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1175,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1187,26) Error: Incompatible types: got "<procedure variable type of function:LongInt of object;StdCall>" expected "LongInt"
StrategyInterfaceUnit.pas(1193,26) Error: Incompatible types: got "<procedure variable type of function:LongInt of object;StdCall>" expected "LongInt"
StrategyInterfaceUnit.pas(1199,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "TDateTime"
StrategyInterfaceUnit.pas(1205,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "TDateTime"
StrategyInterfaceUnit.pas(1211,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1217,26) Error: Incompatible types: got "<procedure variable type of function:LongInt of object;StdCall>" expected "LongInt"
StrategyInterfaceUnit.pas(1223,13) Error: Illegal type conversion: "<procedure variable type of function:LongInt of object;StdCall>" to "TTradePositionType"
StrategyInterfaceUnit.pas(1229,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1235,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1241,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1247,26) Error: Incompatible types: got "<procedure variable type of function:Double of object;StdCall>" expected "Double"
StrategyInterfaceUnit.pas(1253,26) Error: Incompatible types: got "<procedure variable type of function:^Char of object;StdCall>" expected "AnsiString"
StrategyInterfaceUnit.pas(1267,47) Hint: Local variable "info" does not seem to be initialized
StrategyInterfaceUnit.pas(1270,61) Error: Illegal qualifier
StrategyInterfaceUnit.pas(1270,61) Hint: may be pointer dereference is missing
StrategyInterfaceUnit.pas(1270,55) Error: Operator is not overloaded: "Double" \ "PCurrencyInfo"
StrategyInterfaceUnit.pas(1270,61) Fatal: Syntax error, ")" expected but "identifier POINT" found


I refer to this demo strategy in Lesson 1 that doesn't nothing:

Code: Select all

library DemoStrategy;

uses
  SysUtils, StrategyInterfaceUnit, TechnicalFunctions;

procedure InitStrategy; stdcall;
begin
  StrategyShortName('DemoStrategy');
  StrategyDescription('Demo strategy that does nothing');
end;

procedure DoneStrategy; stdcall;
begin

end;

procedure ResetStrategy; stdcall;
begin

end;

procedure GetSingleTick; stdcall;
begin

end;

exports
  InitStrategy,
  DoneStrategy,
  ResetStrategy,
  GetSingleTick;

end.   

Return to “Programming lessons”

Who is online

Users browsing this forum: No registered users and 1 guest