I am trying to create a basic hello world dll using codeblocks and metatrader4 and trying to do it in a striped version. my compile .dll and .def are in the same dir as the .mq4 file.
in file test.mq4
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property strict
//#import "gimmeDLL.dll"
// string GetStringValue(string) define;
//#import
#import "gimmeDLL.dll"
string GetStringValue(string) define;
#import
void OnStart()
{
GetStringValue();
}
in the main.cpp of the dll
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
using namespace std;
#define MT4_EXPFUNC __declspec(dllexport)
void MT4_EXPFUNC GetStringValue()
{
cout << "Hello, World" << endl;
}
in gimmeDLL.def I have
LIBRARY gimmeDLL
EXPORTS
GetStringValue
error
'define' - semicolon expected marketDump.mq4 6 34
'define' - declaration without type marketDump.mq4 6 34
'GetStringValue' - wrong parameters count marketDump.mq4 11 4