Page 1 of 1

Compiler error

Posted: Wed Sep 15, 2010 7:01 am
by SquareMeal
My first time to post, hope this location is OK.

I'm a new ForexTester user - love the program!

I installed Lazarus and am attempting to write my first program using your DemoStrategy as a guide.

When I compile, I get the following error:

DemoStrategy(1,1)Fatal: Can't find unit Graphics used by StrategyInterfaceUnit

I have looked in every subfolder of C:\ForexTester2\... and cannot find any file named Graphics. My thinking was that if I found such a file, I would copy it into my C:\lazarus\projects folder ... correct?

Regards,

Posted: Wed Sep 15, 2010 7:29 am
by FT Support

Can't find unit Graphics used by StrategyInterfaceUnit

Posted: Wed Sep 15, 2010 11:03 pm
by SquareMeal
Thank you for the links. I checked them out and looked into what I found... such as "add the LCL as a requirement to the Lazarus package" (I found a table where it was in there as a requirement)... and then I used a Clean and Build wizard within lazarus to rebuild everything.

I'm still getting the same error and don't know what to do next.

My version of Lazarus is:
0.9.28.2 beta
SVN Revision 22279
i386-win32-win32/win64

I'm running Windows Vista Home (Win32).

Can I show you the contents of any particular directory which might help you guide me?

Thanks,

SquareMeal

Posted: Wed Sep 15, 2010 11:16 pm
by SquareMeal
Ooops... I just noticed that I had not scrolled through a small window created during the build. I received a few error messages. I couldn't copy the text, so I snagged it into a JPG and attached it to this post.

Note: I am willing to use any IDE environment that will run on my machine. I am trying to use Lazarus because the free Delphi IDE was not available on the website -- the only ones available cost big $$$ -- so I am looking for free or cheap.

If you think I should give up on Lazarus and go with something else, please advise.

Regards,
SquareMeal

Posted: Thu Sep 16, 2010 1:54 am
by FT Support
Please try to de-install Lazarus v28 and install v26

Compiling Error

Posted: Thu Sep 16, 2010 8:52 pm
by SquareMeal
I de-installed v28 and installed:

Version 0.9.26.2 beta
FPC Version 2.2.2
SVN Revision 18980
i386-win32

There were no error messages during installation.

I created DemoStrategy as a library project and tried to Build, but got the same error message I've got with v28:

"StrategyInterfaceUnit.pas(1,1)Fatal: Can't find unit graphics used by StrategyInterfaceUnit."

What should I try next?

Thanks,
SquareMeal

Posted: Fri Sep 17, 2010 4:55 am
by FT Support
Please do the following steps:

1) Go to Project -> Project Inspector menu
2) In next window click "Add"
3) In "Add to project window" choose "LCL" on "New Requirement" tab (see "LCL.gif" screenshot)
4) Go to Project -> "Compiler Options"
5) Switch to "Parsing" tab and choose "Delphi" as a Syntax mode
6) Switch to "Code" tab and choose "Target OS" = WinXX

I hope that project will be built successfully after that.
We also recommend to watch this video tutorial to learn more about compilind dlls with Lazarus: http://www.youtube.com/watch?v=kL7z8kG7WCw

Lazarus for Win32 Compiler Error

Posted: Fri Sep 17, 2010 6:36 am
by SquareMeal
That worked -- perfect!

I'll watch the video. Thank you for your help.

SquareMeal

Re: Compiler error

Posted: Sat Nov 21, 2015 11:34 am
by plasmon
Hi,

I have installed Embarcadero® Delphi 10 Seattle Version 23.0.20618.2753 and am trying to execute the simple strategy as described here: viewtopic.php?f=9&t=1013

However, I have copied StrategyInterfaceUnit and TechnicalFunctions to the correct folder, but everytime I try to run the following code, it says '[dcc32 Fatal Error] StrategyInterfaceUnit.pas(83): F2613 Unit 'graphics' not found.'

Could you please help?

This is the code I have been trying to run:

library Project1;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
System.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.


Many thanks.

Re: Compiler error

Posted: Mon Nov 23, 2015 9:48 am
by FX Helper
Hello,

Please try to download and install older version of Delphi, is seems that the problem is in current version.

Re: Compiler error

Posted: Fri Jan 24, 2020 4:38 pm
by plasmon
Hi,

I have once again encountered the error shown above '[dcc32 Fatal Error] StrategyInterfaceUnit.pas(83): F2613 Unit 'graphics' not found.' I am using Rad Studio 10.3 to try to make the dlls. I have tried finding Borland Delphi 2006, which is the one I used last time to overcome this error, this version I can no longer find and even if I could, I'm not sure it would work on Windows 10.
Could you please tell me the best modern solution for writing and compiling dll automated strategies?

Thanks.