Error when importing Library File (.mq4 is not 32-bit version)

 

Hi guys! 

I wrote some functions to a Library File and when i run the strategy tester error occurred, see the pic below

:Picture

When i use Include Files it works perfect. But for some reason to work with library seem a better solution for large EA that i work for. 

I run win10 64-bit version system.(Maybe the problem is there...)

So how can i solve that problem? \

Thanks in advance!!!

 

To use a library you have to use the "#import" directive with the ".ex4" file, not the ".mq4" file.

You can also prepare a Library Header file ".mqh" to define the functions being exported in the library as well as do the actual import for you, and then simply included it at the top of your code with the "#include" directive.

PS! Also, when using "strict" mode, remember to explicitly use the "export" post-modifier in the library to make the functions available outside the library.

 
FMIC:

To use a library you have to use the "#import" directive with the ".ex4" file, not the ".mq4" file.

You can also prepare a Library Header file ".mqh" to define the functions being exported in the library as well as do the actual import for you, and then simply included it at the top of your code with the "#include" directive.

PS! Also, when using "strict" mode, remember to explicitly use the "export" post-modifier in the library to make the functions available outside the library.

Ohhh.... what a fool i am... Thank you FMIC for the quick reply.

 One more question. Can i import library file in to library file? 

 
dionikolo:

One more question. Can i import library file in to library file? 

Yes!
Reason: