Lazarus compile problem - duplicate exported function name

Examples step by step how to make your own automated strategy or user indicator
Message
Author
SquareMeal
Posts: 40
Joined: Wed Sep 15, 2010 6:52 am

Lazarus compile problem - duplicate exported function name

#1 Postby SquareMeal » Sun Oct 17, 2010 8:25 am

I have been having trouble since messing up (and losing) the RSI indicator. So, I just downloaded and re-installed Forex Tester 2.

When I compile a strategy (using Lazarus in Win32 -- which I have been using and it works fine) -- I am now getting the following error message:

Error: Duplicate exported function name "ReplaceStr"

What is odd is that Lazarus usually highlights the errant line of source code when I click on the error message. In this case, Lazarus does not highlight the error source code.

My strategy code contains this statement:
uses
SysUtils, Classes, Graphics, Windows, StrategyInterfaceUnit,
IndicatorInterfaceUnit;

...and I have both interface units open (viewable) at the time of doing the compile.

The only (single) reference I am making to ReplaceStr is in the following section:

exports

InitStrategy,
DoneStrategy,
ResetStrategy,
GetSingleTick,
ReplaceStr,
IntrfProcsRec;

end.

I can't find any "duplicate exported function name."
creativity + willful purpose

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Lazarus compile problem - duplicate exported function na

#2 Postby Terranin » Sun Oct 17, 2010 10:01 am

SquareMeal wrote:I have been having trouble since messing up (and losing) the RSI indicator. So, I just downloaded and re-installed Forex Tester 2.

When I compile a strategy (using Lazarus in Win32 -- which I have been using and it works fine) -- I am now getting the following error message:

Error: Duplicate exported function name "ReplaceStr"

What is odd is that Lazarus usually highlights the errant line of source code when I click on the error message. In this case, Lazarus does not highlight the error source code.

My strategy code contains this statement:
uses
SysUtils, Classes, Graphics, Windows, StrategyInterfaceUnit,
IndicatorInterfaceUnit;

...and I have both interface units open (viewable) at the time of doing the compile.

The only (single) reference I am making to ReplaceStr is in the following section:

exports

InitStrategy,
DoneStrategy,
ResetStrategy,
GetSingleTick,
ReplaceStr,
IntrfProcsRec;

end.

I can't find any "duplicate exported function name."


Your strategy should not contain both StrategyInterfaceUnit and IndicatorInterfaceUnit. You should use only StrategyInterfaceUnit for strategies, and IndicatorInterfaceUnit for indicators.
Hasta la vista
Mike

SquareMeal
Posts: 40
Joined: Wed Sep 15, 2010 6:52 am

#3 Postby SquareMeal » Sun Oct 17, 2010 12:18 pm

Thanks -- that worked -- that makes sense now that I think about it!
creativity + willful purpose


Return to “Programming lessons”

Who is online

Users browsing this forum: No registered users and 17 guests