New MetaTrader 4 Client Terminal Build 507: Trading Signal Registration Command and Setting a Spread When Testing - page 3

 
fudge:

phi.nuts,

2. Don't have it.

3. Yes, files with no include compile and work.

4. Those are my include files, so let's call them a.mqh and dll.mqh.

Case 1:

a.mqh includes dll.mqh

In the main1.mql files the following order works: 

 The following causes a crash:

Case 2:

 In main2.mql only dll.mqh is included and code doens't work, but when I include a.mqh above dll.mqh, the code starts to work, although a.mqh is completely not needed for main.mqh.

 

Are you sure that "a.mqh" does not have something that is needed/required by "dll.mqh" ?

 
fudge:
It does. I wrote that "a.mqh include dll.mqh". I have 0 errors in the compiler in all cases. 
What Build MT4 are you trying to run your code in ?  Build 500 or Build 507 ?
 
phi.nuts:

Are you sure that "a.mqh" does not have something that is needed/required by "dll.mqh" ?

 

It's not, but I've just noticed that I include a.mqh in dll.mqh anyway, even though it's not needed. Hmmm. Removing it, solves my problems... 

My suspicion is that  the new compiler went through some optimizations (and it's not 3 times smaller) and has a bug handling include loops (no ifndef in MQL4 so I can't prevent loops by myself). So on I think that dll has nothing to do here, but a simple include loop will cause an indicator (maybe even an EA) to not work/crash.

 
RaptorUK:
What Build MT4 are you trying to run your code in ?  Build 500 or Build 507 ?


I compile and run under build 507. When I compile with 500 and the include loops exists, everything runs great in build 507.
 

As per this new build, my indicators (which use #include file) produce compile error when attached to chart, even though in MetaEditor they compile flawlessly.

I have tried deleting all .ex4 and mqlcache.dat, the problem persists.

 
rbhauer:

As per this new build, my indicators which uses #include file produces compile error when attached to chart, even though in MetaEditor they compile flawlessly.

I have tried deleting all .ex4 and mqlcache.dat, the problem persists.


If the file has already been complied, a compile error cannot occur when an indicator is attached to a chart. You probably get some other type of error. What exact error do you get? Did you check that your include file doesn't produce an include loop as I described above.(a.mqh includes b.mqh and b.mqh include a.mqh)?
 
fudge:

If the file has already been complied, a compile error cannot occur when an indicator is attached to a chart. You probably get some other type of error. What exact error do you get? Did you check that your include file doesn't produce an include loop as I described above.(a.mqh includes b.mqh and b.mqh include a.mqh)?

No nesting include in mine. Primary mq4 includes two mqh files sequentially. Nothing crazy.


Update: I've tried copy pasting the contents of the included files to avoid the #include call. No failure in compiling. Same error msg appears when attached.

"2013.06.23 21:05:54    IndicatorName EURUSD,M5: executable file is corrupted. Please recompile it."

 
rbhauer:

No nesting include in mine. Primary mq4 includes two mqh files sequentially. Nothing crazy.


1. You didn't say what exact error you are getting.

2. Do the mqh files include additional includes or some DLL imports?

3. Can you try and change the order of the mqh includes and see if it helps?

 

The problem I face with the new build is that the Tester crashes. No matter if I start it from the terminal or with configuration file from the OS. The expert is very simple and I haven't trouble with compilation.

Is there anyone with the same problem?

Win 7 x64

Regards!

 
YanevFX:

The problem I face with the new build is that the Tester crashes. No matter if I start it from the terminal or with a configuration file from the OS. The expert is very simple and I haven't trouble with compilation.

Is there anyone with the same problem?

Win 7 x64

Regards!


1. Did you compile the EA with the new build? If yes, this might be one of the symptoms that I experience.

2. Does your EA includes any mqh files using #include keyword?

3. If your EA is not confidential, can you post it using the SRC button? 

Reason: