I have used matlab 2015a to generate .c
and .dll
files on windows7 as follows :
codegen -config:dll example_fun.m -args {complex(0,0),0,0,0,0}
and I want to use the .dll
output file along with the generated main .c
file using gcc on command prompt as follows:
gcc main.c example_fun.dll -Wl,-rpath=$(pwd)
The .exe file is generated and I am trying to execute on cmd as: a.exe
.
However, I am having this error message error message:
"The program can't start because.dll is missing from your computer. Try reinstalling the program to fix this problem"
Although the .dll file is in the same destination as a.exe.
The strange issue here is that the same procedure works well on linux by executing /a.out and the output is printed just fine.
I believe the whole problem is how to make the generated a.exe sees the .dll alhough -as I have mentioned before- both of them are in the same folder.
I have tried to add the folder's path in the system variables. However, I had the same error message.
So Am I doing any wrong step ? Is there any other way to generate the .exe file and execute it from both main.c and the accompanying .dll generated from matlab codegen?