hi..
i want to know how to make a dll, link c++ and matlab..
tq
If you are using the Visual C++ Compiler, select the Win32 Dynamic Link Library Project option.
Then Select "Create a Simple DLL project"
There will be some WinMain Code included.
After that you put the functions you want to put in.
Example:
-
// DLL.cpp : Defines the entry point for the DLL application.
-
//
-
-
#include "stdafx.h"
-
-
BOOL APIENTRY DllMain( HANDLE hModule,
-
DWORD ul_reason_for_call,
-
LPVOID lpReserved
-
)
-
{
-
return TRUE;
-
}
-
-
//This is the code
-
-
int _stdcall sum(int x , int y)
-
{
-
return x+y;
-
}
-
-
When you have made the .cpp file, you make a .def file.
example: This is the file TUTORIAL1.def
LIBRARY TUTORIAL1
EXPORTS
sum @ 1