Trouble linking against MatLab .dll

Hello,
i recently tried to link a executable (VS 2010) against mat.dll (...and others ...) by adding references to libmat.lib to my project. However, it compiled, but the Output is not able to run unless the .dll files are located in the same folder as the .exe.
I do not know how to solve this and i have been through the settings in VS 2010 over and over again. Is that something special about the MatLab .dll's ?
The .dlls are part of the MCR, so i don't think it is a license issue (?)
I greatly appreciate any help.
Best Regards, ....

2 件のコメント

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 7 月 30 日
Hey Ulrich,
Is it possible to load .lib files to MATLAB?! If not what is the point of mentioning .lib and .exe files?!
I know it's possible to load .dll files with their associated .h files to MATLAB bit I haven't hared about .lib
Sorry I just tagged another question to yours! I don't have the knowledge of what you're doing, I just have a serious problem with loading DLL files to MATLAB.
At some point you have to create prototype file from the header file and use it in MATLAB, some points you have to make thunkfile, which I don't know what's it for!
Ulrich
Ulrich 2014 年 7 月 30 日
Well, i think my problem is the opposite ... i want to use the Matlab .dlls in an external executable. You want to call external .dlls from Matlab. To your problem ... I don't know how this is done directly, i just know it is possible to do it. The only way have done such things yet is to wrap the libraries in a mex file. Maybe you have experience with mex-files, then this would be a way for you. It works very well with static libs as well, that is the main advantage of this approach.
Hope that this helps you a little.
Best Regards,
...

サインインしてコメントする。

 採用された回答

Titus Edelhofer
Titus Edelhofer 2014 年 11 月 13 日

0 投票

Hi Ulrich,
is the folder where you found the libMat.dll on your Windows PATH (when you open CMD window, enter PATH). If not, add it to see if it works by
PATH=%PATH%;C:\FolderWhereYouFoundTheDll
and try to run the executable. If it works, go to the system configuration and add the folder to the environment variable PATH.
Titus

その他の回答 (1 件)

Ulrich
Ulrich 2014 年 11 月 13 日

0 投票

Hi,
i think i tried that, but it is a while ago (as you might already know ... ), so i will try this. I am stuck with another thing by now, so i don't know when, but: i will.
Best regards, ...

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2014 年 7 月 30 日

回答済み:

2014 年 11 月 13 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by