0

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?

  • Your error message shows a main.exe. It looks like you start another executable that is missing some kind of dll (which name is missing, so maybe you reference it wrongly)... Without any more details most people will need to resort to guesswork, so a more complete example would be great, including your code. – flob Aug 14 '17 at 16:04
  • Please include the text of all error messages in the body of the question. Also, what have you done to figure this out on your own? Any steps you have taken, and the results, should be described in the body of the question as well. –  Aug 14 '17 at 16:05
  • removed thanks and intro – Muthu Kumaran Aug 14 '17 at 16:22
  • Thanks guys for your comments. I have taken them in consideration. Please read again my question – ahmed deia Aug 15 '17 at 08:09

0 Answers0