Call a generated .dll file from codegen matlab in c program -


i using codegen in matlab r2016b generate .dll file follows:

codegen -config:dll ex_fun.m -args {0,0,0,0,0,0} 

i have tried include dll file reference using visual studio 2015 nothing works fine , couldn't use .lib file linker eitherll.

the strange thing use gcc on linux compiling .c script calls c function along output .so file (which equivalent .dll in windows) follows:

gcc main.c ex_fun.so -wl,-rpath=$(pwd) 

however, couldn't find direct method in windows. how can use , call .dll file output matlab in c main script program?

it should noted .def file generated don't how use along output dll file.

in visual studio ide:

  • switch platform "x64"

in project properties:

  • c++>general>additional include directories = ^add compilation folder.

  • linker>general>additional libraries directories = ^add compilation
    folder.

  • linker>input>additional dependencies = "ex_fun.lib"

  • in code: add #include "ex_fun.h"
  • after compilation, copy "ex_fun.dll" output folder , run.

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -