Effacer les filtres
Effacer les filtres

Using a shared .dll library while making an executable

1 vue (au cours des 30 derniers jours)
ryan
ryan le 15 Juin 2013
So i know in order to use the 'loadlibrary' function you need a c compiler. But what if i turn the matlab code calling the 'loadlibrary' function into an executable program and that program is used on a computer without a c compiler?
I am using 3 functions from a .dll library, but do not actually have the .c code, otherwise i could just make a mex function using the .c files.
Is it possible to compile a mex64 function with only the .dll library file, and the header file? If not is it possible to write a mex function that uses those files? I want to make the program as versitile as possible, but it needs to be called in matlab.
If anyone has any ideas on what a good way to approach this problem, or general info i would be very thankful.

Réponse acceptée

Walter Roberson
Walter Roberson le 15 Juin 2013
loadlibrary(libname,@protofile)
That is, in a setup run on the development machine you would use the .h to generate the protofile; then the code you would compile would use the @protofile syntax on the already-generated file.
  1 commentaire
ryan
ryan le 18 Juin 2013
walter, This works nice and great, except I am having issues with the code still, and I am starting to think i might have something to do with the endianness. If i instead wrote the program i wanted in c++, and compiled a .mex64 function, once the function is written would i be able to run the program w/out the need for a c/c++ compiler?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by