Thread Subject: loadlibrary addheader

Subject: loadlibrary addheader

From: varun dj

Date: 1 Jul, 2011 03:00:14

Message: 1 of 2

Hello,

I have created abc.dll where i use va_list in abc.h file and have included abc.h, stdarg.h and stdio.h in its abc.cpp file.Now i want to load this abc.dll in matlab.
I used the following command
[n,w] = loadlibrary('abc.dll','abc.h','addheader','stdio.h','addheader',stdarg.h')

But I get the error message:
w = Type 'va_list' was not found. Defaulting to type error.

How can this be solved?

Regards,
Varun.

Subject: loadlibrary addheader

From: Philip Borghesani

Date: 1 Jul, 2011 16:10:51

Message: 2 of 2

On 6/30/2011 11:00 PM, varun dj wrote:
> Hello,
>
> I have created abc.dll where i use va_list in abc.h file and have
> included abc.h, stdarg.h and stdio.h in its abc.cpp file.Now i want to
> load this abc.dll in matlab.
> I used the following command [n,w] =
> loadlibrary('abc.dll','abc.h','addheader','stdio.h','addheader',stdarg.h')
>
> But I get the error message:
> w = Type 'va_list' was not found. Defaulting to type error.
>
> How can this be solved?
>
> Regards,
> Varun.


You missed this line in the loadlibrary documentation:
addheader Loads the functions defined in the additional header file,
hfileN. Note that each file specified by addheader must be referenced by
a corresponding #include statement in the base header file.

So you must add #include statements to 'abc.h' for stdio.h and stdarg.h.

Any function using a va_list will not be callable from MATLAB so the
warning can probably be ignored with no harm done.

Once you add the headers to abc.h you will find that you probably did
not want to use the addheader option.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com