Suppose I am haing a DLL Compiled in C Language. How to I supposed to Include those DLL's into standard path, So that I can able to compile a c application file and execute in Matlab.
Assumed Dll consists of :
<mathlib.h>
// MathLibrary.h - Contains declarations of math functions
#pragma once
#ifdef MATHLIBRARY_EXPORTS
#define MATHLIBRARY_API __declspec(dllexport)
#else
#define MATHLIBRARY_API __declspec(dllimport)
#endif
extern "C" MATHLIBRARY_API int add(int, int);
extern "C" MATHLIBRARY_API int sub(int, int);
extern "C" MATHLIBRARY_API int mul(int, int);
<Mathlibrary.cpp>
// MathLibrary.cpp : Defines the exported functions for the DLL.
#include "pch.h" // use stdafx.h in Visual Studio 2017 and earlier
#include <utility>
#include <limits.h>
#include "mathlib.h"
int add(int x, int y) {
return x + y;
}
int sub(int x, int y) {
return x - y;
}
int mul(int x, int y) {
return x * y;
}
<Mathclient - Application Program>
// MathClient.cpp : Client app for MathLibrary DLL.
// #include "pch.h" Uncomment for Visual Studio 2017 and earlier
//#include <iostream>
#include <stdio.h>
#include "mathlib.h"
int main()
{
printf("The addition is %d\n", add(4,5));
}