I found out that in my header file MainLib.hpp
I had wrong path to my MainDLL.hpp
header. after changing the path the program runs ok
#pragma once
#include "../Libs/MainDLL.hpp"
//#include "MainDLL.hpp" - fails to load MainDLL.dll library
namespace mf {
extern mf::MainFuncPtr MainFunc;
void InitMF(LPCWSTR Path);
void UninitMF(void);
}